mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-18 19:19:36 +02:00
23 lines
557 B
JavaScript
23 lines
557 B
JavaScript
const asyncWrapper = require('../../middleware/asyncWrapper');
|
|
const App = require('../../models/App');
|
|
const ErrorResponse = require('../../utils/ErrorResponse');
|
|
|
|
// @desc Delete app
|
|
// @route DELETE /api/apps/:id
|
|
// @access Public
|
|
const deleteApp = asyncWrapper(async (req, res, next) => {
|
|
if (!req.isAuthenticated) {
|
|
return next(new ErrorResponse('Unauthorized', 401));
|
|
}
|
|
|
|
await App.destroy({
|
|
where: { id: req.params.id },
|
|
});
|
|
|
|
res.status(200).json({
|
|
success: true,
|
|
data: {},
|
|
});
|
|
});
|
|
|
|
module.exports = deleteApp;
|