Skip to content

Commit

Permalink
feat: temporarily disable creative hub api call
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaDiotallevi committed Sep 22, 2024
1 parent d238739 commit 180297e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions serverless/src/actions/stripe_synchroniseProducts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,35 +71,35 @@ export const stripeSynchroniseProducts = async () => {
}

const getProducts = async (): Promise<ProductInput[]> => {
const theprintspaceProducts = await getAllProducts()
// const theprintspaceProducts = await getAllProducts()

const getProductByFilename = (fileName: string) => {
const product = theprintspaceProducts.Data.find(
product => product.FileName === fileName
)
// const getProductByFilename = (fileName: string) => {
// const product = theprintspaceProducts.Data.find(
// product => product.FileName === fileName
// )

return product
}
// return product
// }

return products.map(product => {
const theprintspaceProduct = getProductByFilename(
product.metadata.sku + ".png"
)
// const theprintspaceProduct = getProductByFilename(
// product.metadata.sku + ".png"
// )

if (product.active && !theprintspaceProduct) {
throw new Error(
`No theprintspace product found for sku ${product.metadata.sku}`
)
}
// if (product.active && !theprintspaceProduct) {
// throw new Error(
// `No theprintspace product found for sku ${product.metadata.sku}`
// )
// }

return {
...product,
metadata: {
...product.metadata,
theprintspaceProductId: String(theprintspaceProduct?.Id),
theprintspacePrintOptionId: String(
theprintspaceProduct?.PrintOptions[0].Id
),
// theprintspaceProductId: String(theprintspaceProduct?.Id),
// theprintspacePrintOptionId: String(
// theprintspaceProduct?.PrintOptions[0].Id
// ),
},
}
})
Expand Down

0 comments on commit 180297e

Please sign in to comment.