({ request })
| 2 | import db from "../db.server"; |
| 3 | |
| 4 | export const action = async ({ request }) => { |
| 5 | const { topic, shop, session } = await authenticate.webhook(request); |
| 6 | |
| 7 | switch (topic) { |
| 8 | case "APP_UNINSTALLED": |
| 9 | if (session) { |
| 10 | await db.session.deleteMany({ where: { shop } }); |
| 11 | } |
| 12 | break; |
| 13 | case "CUSTOMERS_DATA_REQUEST": |
| 14 | case "CUSTOMERS_REDACT": |
| 15 | case "SHOP_REDACT": |
| 16 | default: |
| 17 | throw new Response("Unhandled webhook topic", { status: 404 }); |
| 18 | } |
| 19 | |
| 20 | throw new Response(); |
| 21 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected