From 3131f2aa353b96c9a3bbe6939cd2eaa28cccaa27 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 18 Aug 2022 15:46:25 +0530 Subject: [PATCH] fix: correctly create product --- src/Socket/business.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Socket/business.ts b/src/Socket/business.ts index 21838f3..993fb42 100644 --- a/src/Socket/business.ts +++ b/src/Socket/business.ts @@ -171,6 +171,8 @@ export const makeBusinessSocket = (config: SocketConfig) => { } const productCreate = async(create: ProductCreate) => { + // ensure isHidden is defined + create.isHidden = !!create.isHidden create = await uploadingNecessaryImagesOfProduct(create, waUploadToServer) const createNode = toProductNode(undefined, create) @@ -185,7 +187,19 @@ export const makeBusinessSocket = (config: SocketConfig) => { { tag: 'product_catalog_add', attrs: { v: '1' }, - content: [ createNode ] + content: [ + createNode, + { + tag: 'width', + attrs: { }, + content: '100' + }, + { + tag: 'height', + attrs: { }, + content: '100' + } + ] } ] })