Skip to content

Commit

Permalink
fix(core): Fix update of ProductVariant with relation custom fields
Browse files Browse the repository at this point in the history
Fixes #997
  • Loading branch information
michaelbromley committed Jul 22, 2021
1 parent fc3a9c5 commit 6e794c0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Injectable } from '@nestjs/common';
import { pick } from '@vendure/common/lib/pick';
import { ID, Type } from '@vendure/common/lib/shared-types';
import { getGraphQlInputName } from '@vendure/common/lib/shared-utils';

Expand Down Expand Up @@ -51,7 +52,7 @@ export class CustomFieldRelationService {
entity.customFields = { ...entity.customFields, [field.name]: relations };
await this.connection
.getRepository(ctx, entityType)
.save(entity as any, { reload: false });
.save(pick(entity, ['id', 'customFields']) as any, { reload: false });
}
}
}
Expand Down

0 comments on commit 6e794c0

Please sign in to comment.