More sync cleanup and fixing
This commit is contained in:
@@ -147,7 +147,7 @@ export const app = new Elysia()
|
||||
})
|
||||
// Per-product sync
|
||||
.post("/:printfulProductId", async ({ params }) => {
|
||||
if (!await productSyncer.sync(params.printfulProductId))
|
||||
if (!await productSyncer.sync({ printfulProductIdsFilter: [params.printfulProductId] }))
|
||||
throw status(409, "Sync already in progress");
|
||||
}, { params: z.object({ printfulProductId: z.coerce.number() }) }),
|
||||
)
|
||||
@@ -175,7 +175,7 @@ export const app = new Elysia()
|
||||
case Printful.Webhook.Event.ProductUpdated: {
|
||||
const printfulProduct = payload.data.sync_product;
|
||||
log.info({ productId: printfulProduct.id }, "printful webhook: product updated");
|
||||
await productSyncer.sync(printfulProduct.id);
|
||||
await productSyncer.sync({ printfulProductIdsFilter: [printfulProduct.id] });
|
||||
break;
|
||||
}
|
||||
case Printful.Webhook.Event.ProductDeleted: {
|
||||
|
||||
Reference in New Issue
Block a user