Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes committed May 30, 2022
1 parent 900fba1 commit 599d0bf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/api/src/platforms/vtex/utils/propertyValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<IStorePropertyValue, 'name' | 'value' | 'valueReference'>
) {
return md5(
`${item.name}:${JSON.stringify(item.value)}:${item.valueReference}`
)
Expand Down

0 comments on commit 599d0bf

Please sign in to comment.