Browse Source

fix(core): Check existence of ProductVariant before updating

Michael Bromley 6 years ago
parent
commit
fe5eedd233
1 changed files with 1 additions and 0 deletions
  1. 1 0
      packages/core/src/service/services/product-variant.service.ts

+ 1 - 0
packages/core/src/service/services/product-variant.service.ts

@@ -167,6 +167,7 @@ export class ProductVariantService {
     }
     }
 
 
     async update(ctx: RequestContext, input: UpdateProductVariantInput): Promise<Translated<ProductVariant>> {
     async update(ctx: RequestContext, input: UpdateProductVariantInput): Promise<Translated<ProductVariant>> {
+        await getEntityOrThrow(this.connection, ProductVariant, input.id);
         await this.translatableSaver.update({
         await this.translatableSaver.update({
             input,
             input,
             entityType: ProductVariant,
             entityType: ProductVariant,