Skip to content

Commit

Permalink
Merge 799b0c9 into 25e0e4a
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelyali committed Oct 4, 2019
2 parents 25e0e4a + 799b0c9 commit c77db22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/crud-typeorm/src/typeorm-crud.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class TypeOrmCrudService<T> extends CrudService<T> {
const toSave = !allowParamsOverride
? { ...found, ...dto, ...paramsFilters }
: { ...found, ...dto };
const updated = await this.repo.save(toSave);
const updated = await this.repo.save(plainToClass(this.entityType, toSave));

if (returnShallow) {
return updated;
Expand All @@ -176,7 +176,7 @@ export class TypeOrmCrudService<T> extends CrudService<T> {
? { ...dto, ...paramsFilters }
: { ...paramsFilters, ...dto };

const replaced = await this.repo.save(toSave);
const replaced = await this.repo.save(plainToClass(this.entityType, toSave));

if (returnShallow) {
return replaced;
Expand Down

0 comments on commit c77db22

Please sign in to comment.