Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: add GET handler for paperless webhook

Brad Barbin6bbbbd2bcb60
diff --git a/apps/erp/app/routes/api+/webhook.paperless-parts.$companyId.ts b/apps/erp/app/routes/api+/webhook.paperless-parts.$companyId.ts
index b0bb869817..3052d71521 100644
--- a/apps/erp/app/routes/api+/webhook.paperless-parts.$companyId.ts
+++ b/apps/erp/app/routes/api+/webhook.paperless-parts.$companyId.ts
@@ -1,7 +1,11 @@
import { getCarbonServiceRole } from "@carbon/auth";
import type { paperlessPartsTask } from "@carbon/jobs/trigger/paperless-parts";
import { tasks } from "@trigger.dev/sdk/v3";
-import { json, type ActionFunctionArgs } from "@vercel/remix";
+import type {
+ LoaderFunctionArgs,
+ type ActionFunctionArgs,
+} from "@vercel/remix";
+import { json } from "@vercel/remix";
import crypto from "crypto";
import { z } from "zod";
import { getIntegration } from "~/modules/settings/settings.service";
@@ -30,6 +34,17 @@ function createHmacSignature(
.digest("hex");
}
+export async function loader({ request, params }: LoaderFunctionArgs) {
+ const { companyId } = params;
+ if (!companyId) {
+ return json({ success: false }, { status: 400 });
+ }
+
+ return json({
+ success: true,
+ });
+}
+
export async function action({ request, params }: ActionFunctionArgs) {
const { companyId } = params;
if (!companyId) {