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: work center options

Brad Barbin3fbbdfb6edfa
diff --git a/apps/erp/app/components/Form/WorkCenter.tsx b/apps/erp/app/components/Form/WorkCenter.tsx
index 263e65cc38..32272ef12f 100644
--- a/apps/erp/app/components/Form/WorkCenter.tsx
+++ b/apps/erp/app/components/Form/WorkCenter.tsx
@@ -85,6 +85,8 @@ export const useWorkCenters = (args: {
workCenterFetcher.load(path.to.api.workCenters);
});
+ console.log({ args, data: workCenterFetcher.data });
+
const options = useMemo(
() =>
workCenterFetcher.data?.data
@@ -92,15 +94,13 @@ export const useWorkCenters = (args: {
.filter((f) => {
if (processId && locationId) {
return (
- // @ts-ignore
- (f.processes ?? []).map((p) => p.id).includes(processId) &&
+ (f.processes ?? []).includes(processId) &&
f.locationId === locationId
);
}
if (processId) {
- // @ts-ignore
- return (f.processes ?? []).map((p) => p.id).includes(processId);
+ return (f.processes ?? []).includes(processId);
}
if (locationId) {