import type { ActionFunctionArgs } from "@remix-run/node"; import db from "../db.server"; import { authenticate } from "../shopify.server"; // GDPR: shop uninstalled the app 48 hours ago — erase all shop data. // TODO (Phase 8): once the full schema exists, delete every row scoped to // this shopDomain across Location/SlotTemplate/Booking/etc. export const action = async ({ request }: ActionFunctionArgs) => { const { shop, topic, payload } = await authenticate.webhook(request); console.log(`Received ${topic} webhook for ${shop}`, payload); await db.session.deleteMany({ where: { shop } }); return new Response(); };