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.

comments resolution

aashub5a805b34eb5
diff --git a/apps/erp/app/routes/x+/job+/methods+/$jobId.operation.delete.tsx b/apps/erp/app/routes/x+/job+/methods+/$jobId.operation.delete.tsx
index 48fb8ef56e..9d4dd90b97 100644
--- a/apps/erp/app/routes/x+/job+/methods+/$jobId.operation.delete.tsx
+++ b/apps/erp/app/routes/x+/job+/methods+/$jobId.operation.delete.tsx
@@ -35,6 +35,15 @@ export async function action({ request, params }: ActionFunctionArgs) {
.from("productionEvent")
.select("id", { count: "exact", head: true })
.eq("jobOperationId", id);
+ if (events.error) {
+ return data(
+ {
+ success: false,
+ error: "Failed to check for recorded production events"
+ },
+ { status: 500 }
+ );
+ }
if ((events.count ?? 0) > 0) {
return data(
{