Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

set clickId = "" for invalid clickIds

Steven Tey217ffa85afb0
diff --git a/apps/web/app/api/shopify/pixel/route.ts b/apps/web/app/api/shopify/pixel/route.ts
index 42eb06f383..bc84d9506a 100644
--- a/apps/web/app/api/shopify/pixel/route.ts
+++ b/apps/web/app/api/shopify/pixel/route.ts
@@ -17,7 +17,7 @@ const CORS_HEADERS = {
// POST /api/shopify/pixel – Handle the Shopify Pixel events
export const POST = async (req: Request) => {
try {
- const { clickId, checkoutToken } = await parseRequestBody(req);
+ let { clickId, checkoutToken } = await parseRequestBody(req);
if (!checkoutToken) {
throw new DubApiError({
@@ -42,7 +42,7 @@ export const POST = async (req: Request) => {
const clickEvent = await getClickEvent({ clickId });
if (!clickEvent || clickEvent.data.length === 0) {
- return new Response(`Click event not found for clickId: ${clickId}`);
+ clickId = null;
}
}