initial version (template only)

This commit is contained in:
Gerhard Scheikl
2026-04-28 13:34:35 +02:00
commit 0f75dbaccb
44 changed files with 14066 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import type { ActionFunctionArgs } from "react-router";
import { authenticate } from "../shopify.server";
import db from "../db.server";
export const action = async ({ request }: ActionFunctionArgs) => {
const { shop, session, topic } = await authenticate.webhook(request);
console.log(`Received ${topic} webhook for ${shop}`);
// Webhook requests can trigger multiple times and after an app has already been uninstalled.
// If this webhook already ran, the session may have been deleted previously.
if (session) {
await db.session.deleteMany({ where: { shop } });
}
return new Response();
};