From 6ae8fcebcd8ec63f145a802ee2be2f4fa27957ac Mon Sep 17 00:00:00 2001 From: Magdalena Markusik Date: Mon, 21 Sep 2020 12:24:11 +0200 Subject: [PATCH] update product create mutation create handler --- src/products/mutations.ts | 4 ++++ src/products/types/ProductCreate.ts | 1 + src/products/types/ProductUpdate.ts | 1 + src/products/views/ProductCreate.tsx | 1 + 4 files changed, 7 insertions(+) diff --git a/src/products/mutations.ts b/src/products/mutations.ts index 12d6d4de3..822613639 100644 --- a/src/products/mutations.ts +++ b/src/products/mutations.ts @@ -145,6 +145,7 @@ export const productUpdateMutation = gql` $name: String $basePrice: PositiveDecimal $seo: SeoInput + $slug: String $visibleInListings: Boolean ) { productUpdate( @@ -160,6 +161,7 @@ export const productUpdateMutation = gql` name: $name basePrice: $basePrice seo: $seo + slug: $slug visibleInListings: $visibleInListings } ) { @@ -291,6 +293,7 @@ export const productCreateMutation = gql` $productType: ID! $sku: String $seo: SeoInput + $slug: String $stocks: [StockInput!]! $trackInventory: Boolean! $weight: WeightScalar @@ -310,6 +313,7 @@ export const productCreateMutation = gql` productType: $productType sku: $sku seo: $seo + slug: $slug stocks: $stocks trackInventory: $trackInventory weight: $weight diff --git a/src/products/types/ProductCreate.ts b/src/products/types/ProductCreate.ts index b8dd2ca59..cd92d5e9f 100644 --- a/src/products/types/ProductCreate.ts +++ b/src/products/types/ProductCreate.ts @@ -244,6 +244,7 @@ export interface ProductCreateVariables { productType: string; sku?: string | null; seo?: SeoInput | null; + slug?: string | null; stocks: StockInput[]; trackInventory: boolean; weight?: any | null; diff --git a/src/products/types/ProductUpdate.ts b/src/products/types/ProductUpdate.ts index 6a10c903b..97c82d533 100644 --- a/src/products/types/ProductUpdate.ts +++ b/src/products/types/ProductUpdate.ts @@ -243,5 +243,6 @@ export interface ProductUpdateVariables { name?: string | null; basePrice?: any | null; seo?: SeoInput | null; + slug?: string | null; visibleInListings?: boolean | null; } diff --git a/src/products/views/ProductCreate.tsx b/src/products/views/ProductCreate.tsx index 24d06a9da..2ed4172ef 100644 --- a/src/products/views/ProductCreate.tsx +++ b/src/products/views/ProductCreate.tsx @@ -95,6 +95,7 @@ export const ProductCreateView: React.FC = () => { title: formData.seoTitle }, sku: formData.sku, + slug: formData.slug, stocks: formData.stocks.map(stock => ({ quantity: parseInt(stock.value, 0), warehouse: stock.id