From 599d0bfee96f95f5b3001b268c81e9b017368ca2 Mon Sep 17 00:00:00 2001 From: Tiago Gimenes Date: Mon, 30 May 2022 09:39:35 -0300 Subject: [PATCH] fix build --- .../api/src/platforms/vtex/utils/propertyValue.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/api/src/platforms/vtex/utils/propertyValue.ts b/packages/api/src/platforms/vtex/utils/propertyValue.ts index 6c240213ca..733f23c4a0 100644 --- a/packages/api/src/platforms/vtex/utils/propertyValue.ts +++ b/packages/api/src/platforms/vtex/utils/propertyValue.ts @@ -8,14 +8,21 @@ export const VALUE_REFERENCES = { } as const export function attachmentToPropertyValue(attachment: Attachment) { - return { + const property = { name: attachment.name, value: attachment.content, valueReference: VALUE_REFERENCES.attachment, } + + return { + ...property, + propertyID: getPropertyId(property), + } } -export function getPropertyId(item: IStorePropertyValue) { +export function getPropertyId( + item: Pick +) { return md5( `${item.name}:${JSON.stringify(item.value)}:${item.valueReference}` )