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: remove deferred promise

Sidwebworks0844298491d5
diff --git a/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.$lineId.details.tsx b/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.$lineId.details.tsx
index f9ed44fa71..6c99538e0b 100644
--- a/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.$lineId.details.tsx
+++ b/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.$lineId.details.tsx
@@ -44,11 +44,14 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const { lineId } = params;
if (!lineId) throw notFound("lineId not found");
- const purchaseInvoiceLine = await getPurchaseInvoiceLine(client, lineId);
+ const [purchaseInvoiceLine, files] = await Promise.all([
+ getPurchaseInvoiceLine(client, lineId),
+ getSupplierInteractionLineDocuments(client, companyId, lineId)
+ ]);
return {
purchaseInvoiceLine: purchaseInvoiceLine?.data ?? null,
- files: getSupplierInteractionLineDocuments(client, companyId, lineId)
+ files
};
}
diff --git a/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.$lineId.details.tsx b/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.$lineId.details.tsx
index ddbac71dfa..72c3e944fb 100644
--- a/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.$lineId.details.tsx
+++ b/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.$lineId.details.tsx
@@ -50,7 +50,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
return {
salesInvoiceLine: salesInvoiceLine?.data ?? null,
- files: getOpportunityLineDocuments(client, companyId, lineId, itemId)
+ files: await getOpportunityLineDocuments(client, companyId, lineId, itemId)
};
}