Skip to content

Commit

Permalink
Add user to product
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalsoueidan committed May 14, 2024
1 parent db507bc commit 6f8c89b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion openapi/paths/customer/create/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ post:
tags:
- Customer
operationId: customerCreate
summary: PUT Create user
summary: POST Create user
description: This endpoint creates new user
requestBody:
required: true
Expand Down
4 changes: 2 additions & 2 deletions src/functions/customer/services/product/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export const CustomerProductServiceAdd = async (
value: shopifyProduct.user?.value,
},
hideFromCombineMetafieldId: shopifyProduct.hideFromCombine?.id,
hideFromCombine: body.hideFromCombine,
hideFromCombine: body.hideFromCombine || false,
hideFromProfileMetafieldId: shopifyProduct.hideFromProfile?.id,
hideFromProfile: body.hideFromProfile,
hideFromProfile: body.hideFromProfile || false,
compareAtPrice: {
amount: body.compareAtPrice.amount,
currencyCode: "DKK",
Expand Down
5 changes: 2 additions & 3 deletions src/functions/customer/services/product/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,11 @@ export const CustomerProductServiceUpdate = async (
},
]
: []),
...(user.images?.profile?.metaobjectId &&
user.images?.profile?.metaobjectId !== oldProduct.user?.value
...(user.userMetaobjectId !== oldProduct.user?.value
? [
{
id: oldProduct?.user?.metaobjectId,
value: user.images.profile.metaobjectId,
value: user.userMetaobjectId,
},
]
: []),
Expand Down

0 comments on commit 6f8c89b

Please sign in to comment.