From aaf968b667b9bc72b024e1297df1f7f63e9a4bb9 Mon Sep 17 00:00:00 2001 From: Jamal Soueidan Date: Sun, 14 Jul 2024 15:24:52 +0200 Subject: [PATCH] Add CustomerProductServiceUpdate call in webhookProductUpdate function --- src/functions/webook-product.function.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/functions/webook-product.function.ts b/src/functions/webook-product.function.ts index f713e413..566f6a0b 100644 --- a/src/functions/webook-product.function.ts +++ b/src/functions/webook-product.function.ts @@ -3,6 +3,7 @@ import "module-alias/register"; import { app, HttpRequest, InvocationContext } from "@azure/functions"; import * as df from "durable-functions"; import { connect } from "~/library/mongoose"; +import { CustomerProductServiceUpdate } from "./customer/services/product/update"; import { WebhookUpdateProductOrchestration } from "./webhook/product/update"; type Product = { @@ -81,6 +82,14 @@ app.http("webhookProductUpdate", { const customerId = match[1]; console.log(`User ID: ${customerId}, - ${shopifyProduct.id}`); + await CustomerProductServiceUpdate( + { + customerId: parseInt(customerId), + productId: shopifyProduct.id, + }, + { title: shopifyProduct.title, description: shopifyProduct.body_html } + ); + await WebhookUpdateProductOrchestration( { customerId: parseInt(customerId),