Reserve material lots from cut plans
This commit is contained in:
@@ -16,7 +16,8 @@ router.get('/production-orders', verifyToken, async (req, res) => {
|
||||
router.post('/production-orders', verifyToken, async (req, res) => {
|
||||
try {
|
||||
const orders = Array.isArray(req.body?.orders) ? req.body.orders : [];
|
||||
res.status(201).json(await createProductionOrders(orders));
|
||||
const lotReservations = Array.isArray(req.body?.lotReservations) ? req.body.lotReservations : [];
|
||||
res.status(201).json(await createProductionOrders(orders, lotReservations));
|
||||
} catch (error) {
|
||||
console.error('Error creating production orders:', error);
|
||||
res.status(error.statusCode || 500).json({ error: error.message || 'Internal Server Error' });
|
||||
|
||||
Reference in New Issue
Block a user