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.

fix: fallback for missing item in onshape

Brad Barbinf29fc49f2451
diff --git a/apps/erp/app/routes/api+/integrations.onshape.d.$did.v.$vid.e.$eid.bom.ts b/apps/erp/app/routes/api+/integrations.onshape.d.$did.v.$vid.e.$eid.bom.ts
index f84dbba790..2aff83142e 100644
--- a/apps/erp/app/routes/api+/integrations.onshape.d.$did.v.$vid.e.$eid.bom.ts
+++ b/apps/erp/app/routes/api+/integrations.onshape.d.$did.v.$vid.e.$eid.bom.ts
@@ -149,7 +149,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
return {
// biome-ignore lint/complexity/useLiteralKeys: suppressed due to migration
- index: row["Item"],
+ index: row["Item"] ?? "",
readableId: row["Part number"],
// biome-ignore lint/complexity/useLiteralKeys: suppressed due to migration
revision: row["Revision"],
@@ -166,7 +166,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
// biome-ignore lint/complexity/useLiteralKeys: suppressed due to migration
quantity: row["Quantity"],
// biome-ignore lint/complexity/useLiteralKeys: suppressed due to migration
- level: row["Item"].toString().split(".").length,
+ level: row["Item"]?.toString().split(".").length ?? 1,
data: row
};
});