UNPKG

express-crud-router

Version:

React Admin backend for Express. 1 line per resource! ORM agnostic.

22 lines (19 loc) 356 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.destroy = void 0; const destroy = doDestroy => async (req, res, next) => { try { await doDestroy(req.params.id, { req, res }); res.json({ id: req.params.id }); } catch (error) { next(error); } }; exports.destroy = destroy;