Import Tiny product compositions
This commit is contained in:
@@ -12,6 +12,7 @@ const {
|
||||
listConsumptionReferences,
|
||||
listProducts
|
||||
} = require('../services/catalogService');
|
||||
const { importTinyProductCompositionExport } = require('../services/productionOrderService');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
@@ -89,6 +90,14 @@ router.post('/catalog/consumption-references', verifyToken, async (req, res, nex
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/catalog/product-compositions/import', verifyToken, async (req, res, next) => {
|
||||
try {
|
||||
res.status(201).json(await importTinyProductCompositionExport(req.body || {}));
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
router.delete('/catalog/consumption-references/:id', verifyToken, async (req, res, next) => {
|
||||
try {
|
||||
await deleteConsumptionReference(req.params.id);
|
||||
|
||||
Reference in New Issue
Block a user