Add delete route handlers for GCode files and printers
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:
Tom Butcher 2026-09-13 17:21:25 +01:00
parent c679066504
commit 622f4b20f2
2 changed files with 11 additions and 1 deletions

View File

@ -29,7 +29,8 @@ import {
getGCodeFilePropertyValuesRouteHandler,
getGCodeFileNeighborsRouteHandler,
deleteGCodeFileByFilterRouteHandler
deleteGCodeFileByFilterRouteHandler,
deleteGCodeFileRouteHandler
} from '../../services/production/gcodefiles.js';
import { convertPropertiesString, getFilter, getSort } from '../../utils.js';
@ -122,4 +123,8 @@ router.put('/:id', isAuthenticated, checkPermissions('gcodeFile', 'edit'), async
editGCodeFileRouteHandler(req, res);
});
router.delete('/:id', isAuthenticated, checkPermissions('gcodeFile', 'delete'), async (req, res) => {
deleteGCodeFileRouteHandler(req, res);
});
export default router;

View File

@ -15,6 +15,7 @@ import {
getPrinterPropertyValuesRouteHandler,
getPrinterNeighborsRouteHandler,
deletePrinterByFilterRouteHandler,
deletePrinterRouteHandler,
} from '../../services/production/printers.js';
import { convertPropertiesString, getFilter, getSort } from '../../utils.js';
@ -122,4 +123,8 @@ router.put('/:id', isAuthenticated, checkPermissions('printer', 'edit'), async (
editPrinterRouteHandler(req, res);
});
router.delete('/:id', isAuthenticated, checkPermissions('printer', 'delete'), async (req, res) => {
deletePrinterRouteHandler(req, res);
});
export default router;