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 sale orders api route

Brad Barbin3104b11262dd
diff --git a/apps/erp/app/routes/api+/sales.orders.ts b/apps/erp/app/routes/api+/sales.orders.ts
new file mode 100644
index 0000000000..b876a0c1b1
--- /dev/null
+++ b/apps/erp/app/routes/api+/sales.orders.ts
@@ -0,0 +1,12 @@
+import { requirePermissions } from "@carbon/auth/auth.server";
+import type { LoaderFunctionArgs } from "@vercel/remix";
+import { json } from "@vercel/remix";
+import { getSalesOrdersList } from "~/modules/sales";
+
+export async function loader({ request }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "sales",
+ });
+
+ return json(await getSalesOrdersList(client, companyId));
+}