Add delete route handlers for GCode files and printers
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces new route handlers for deleting GCode files and printers, enhancing the application's data management capabilities. The `deleteGCodeFileRouteHandler` and `deletePrinterRouteHandler` are added, allowing for individual deletion of these entities. Additionally, the necessary authentication and permission checks are implemented for these routes, ensuring secure access control.
This commit is contained in:
parent
c679066504
commit
622f4b20f2
@ -29,7 +29,8 @@ import {
|
|||||||
getGCodeFilePropertyValuesRouteHandler,
|
getGCodeFilePropertyValuesRouteHandler,
|
||||||
|
|
||||||
getGCodeFileNeighborsRouteHandler,
|
getGCodeFileNeighborsRouteHandler,
|
||||||
deleteGCodeFileByFilterRouteHandler
|
deleteGCodeFileByFilterRouteHandler,
|
||||||
|
deleteGCodeFileRouteHandler
|
||||||
} from '../../services/production/gcodefiles.js';
|
} from '../../services/production/gcodefiles.js';
|
||||||
import { convertPropertiesString, getFilter, getSort } from '../../utils.js';
|
import { convertPropertiesString, getFilter, getSort } from '../../utils.js';
|
||||||
|
|
||||||
@ -122,4 +123,8 @@ router.put('/:id', isAuthenticated, checkPermissions('gcodeFile', 'edit'), async
|
|||||||
editGCodeFileRouteHandler(req, res);
|
editGCodeFileRouteHandler(req, res);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.delete('/:id', isAuthenticated, checkPermissions('gcodeFile', 'delete'), async (req, res) => {
|
||||||
|
deleteGCodeFileRouteHandler(req, res);
|
||||||
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import {
|
|||||||
getPrinterPropertyValuesRouteHandler,
|
getPrinterPropertyValuesRouteHandler,
|
||||||
getPrinterNeighborsRouteHandler,
|
getPrinterNeighborsRouteHandler,
|
||||||
deletePrinterByFilterRouteHandler,
|
deletePrinterByFilterRouteHandler,
|
||||||
|
deletePrinterRouteHandler,
|
||||||
} from '../../services/production/printers.js';
|
} from '../../services/production/printers.js';
|
||||||
import { convertPropertiesString, getFilter, getSort } from '../../utils.js';
|
import { convertPropertiesString, getFilter, getSort } from '../../utils.js';
|
||||||
|
|
||||||
@ -122,4 +123,8 @@ router.put('/:id', isAuthenticated, checkPermissions('printer', 'edit'), async (
|
|||||||
editPrinterRouteHandler(req, res);
|
editPrinterRouteHandler(req, res);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.delete('/:id', isAuthenticated, checkPermissions('printer', 'delete'), async (req, res) => {
|
||||||
|
deletePrinterRouteHandler(req, res);
|
||||||
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user