rez_core 3.1.46 → 3.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "3.1.46",
3
+ "version": "3.1.47",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -1,4 +1,16 @@
1
- import { Body, Controller, Get, Inject, Param, Post, Query, Req, UseGuards } from '@nestjs/common';
1
+ import {
2
+ Body,
3
+ Controller,
4
+ Get,
5
+ HttpCode,
6
+ HttpStatus,
7
+ Inject,
8
+ Param,
9
+ Post,
10
+ Query,
11
+ Req,
12
+ UseGuards,
13
+ } from '@nestjs/common';
2
14
  import { FieldMapperService } from '../service/field-mapper.service';
3
15
  import { JwtAuthGuard } from '../../auth/guards/jwt.guard';
4
16
  import { FieldMapperDto } from '../dto/field-mapper.dto';
@@ -19,6 +31,7 @@ export class FieldMapperController {
19
31
 
20
32
 
21
33
  @Post('bulk')
34
+ @HttpCode(HttpStatus.OK)
22
35
  async createBulk(@Req() req: any, @Body() dtos: FieldMapperDto[]) {
23
36
  const loggedInUser = req.user.userData;
24
37
  return this.fieldMapperService.createFieldMappers(dtos, loggedInUser);
@@ -7,6 +7,7 @@ import { SavedFilterService } from '../../filter/service/saved-filter.service';
7
7
  import { FieldLovsRepository } from '../repository/field-lovs.repository';
8
8
  import { DataSource } from 'typeorm';
9
9
  import { FilterService } from 'src/module/filter/service/filter.service';
10
+ import { BaseEntity } from '../../meta/entity/base-entity.entity';
10
11
 
11
12
  @Injectable()
12
13
  export class FieldMapperService extends EntityServiceImpl {
@@ -37,9 +38,12 @@ export class FieldMapperService extends EntityServiceImpl {
37
38
  }
38
39
 
39
40
  async createFieldMappers(dtos: FieldMapperDto[], loggedInUser: UserData) {
41
+ let result: BaseEntity[] = [];
40
42
  for (const dto of dtos) {
41
- await super.createEntity(dto, loggedInUser);
43
+ const fieldMapper = await super.createEntity(dto, loggedInUser);
44
+ result.push(fieldMapper)
42
45
  }
46
+ return result;
43
47
  }
44
48
 
45
49
  async getMapperFields(mapperId: number) {