Skip to content

Commit

Permalink
Add CustomerProductServiceUpdate call in webhookProductUpdate function
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalsoueidan committed Jul 14, 2024
1 parent e3a5ce0 commit aaf968b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/functions/webook-product.function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit aaf968b

Please sign in to comment.