Skip to content

Commit ad58e56

Browse files
IKarbowiakclaude
andcommitted
Fix missing Product Variant webhook events group
Add PRODUCT_VARIANT to the multiWords list so variant events appear as a separate object group in the webhook events UI. Previously, Product Variant events were not visible at all. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 03674f6 commit ad58e56

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/extensions/components/WebhookDetailsPage/components/WebhookEvents/utils.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ describe("getWebhookTypes", () => {
1212
it("should map array of enum keys to objects with events ", () => {
1313
const TestWebhookTypes = getWebhookTypes(TestKeys);
1414

15-
expect(Object.keys(TestWebhookTypes)).toEqual(["DRAFT_ORDER", "PRODUCT"]);
15+
expect(Object.keys(TestWebhookTypes)).toEqual(["DRAFT_ORDER", "PRODUCT", "PRODUCT_VARIANT"]);
1616
expect(TestWebhookTypes.DRAFT_ORDER).toEqual(["CREATED", "UPDATED"]);
17-
expect(TestWebhookTypes.PRODUCT).toEqual(["CREATED", "UPDATED", "VARIANT_UPDATED"]);
17+
expect(TestWebhookTypes.PRODUCT).toEqual(["CREATED", "UPDATED"]);
18+
expect(TestWebhookTypes.PRODUCT_VARIANT).toEqual(["UPDATED"]);
1819
});
1920
});

src/extensions/components/WebhookDetailsPage/components/WebhookEvents/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { WebhookEventTypeAsyncEnum, WebhookEventTypeSyncEnum } from "@dashboard/
33
type Actions = string[];
44

55
export const getWebhookTypes = (webhookEvents: string[]) => {
6-
const multiWords = ["DRAFT_ORDER", "GIFT_CARD", "ANY_EVENTS"];
6+
const multiWords = ["DRAFT_ORDER", "GIFT_CARD", "ANY_EVENTS", "PRODUCT_VARIANT"];
77

88
return webhookEvents.sort().reduce<Record<string, Actions>>((acc, key) => {
99
const keywords = key.split("_");

0 commit comments

Comments
 (0)