import type { ActionFunctionArgs } from "@remix-run/node"; import { authenticate } from "../shopify.server"; import { purgeShopData } from "../services/gdpr.server"; // GDPR: shop uninstalled the app 48 hours ago — erase all shop data. export const action = async ({ request }: ActionFunctionArgs) => { const { shop, topic, payload } = await authenticate.webhook(request); console.log(`[gdpr] ${topic} for ${shop} — purging all shop data`, payload); await purgeShopData(shop); return new Response(); };