Add persistent production plans

This commit is contained in:
Cauê Faleiros
2026-08-25 11:47:07 -03:00
parent 21d9960145
commit 85afba4e5b
10 changed files with 493 additions and 16 deletions

View File

@@ -2667,7 +2667,12 @@ const PurchaseOrdersScreen = () => {
const [nextOrders, nextSuppliers] = await Promise.all([fetchSupplyPurchaseOrders(), fetchSupplySuppliers()]);
setOrders(nextOrders); setSuppliers(nextSuppliers);
};
useEffect(() => { void load().catch(error => setMessage(error instanceof Error ? error.message : 'Não foi possível carregar as OCs.')); }, []);
useEffect(() => {
const timer = window.setTimeout(() => {
void load().catch(error => setMessage(error instanceof Error ? error.message : 'Não foi possível carregar as OCs.'));
}, 0);
return () => window.clearTimeout(timer);
}, []);
const submit = async (event: FormEvent<HTMLFormElement>) => {
event.preventDefault(); setBusy(true); setMessage('');
try {