mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 07:01:55 +08:00
a7e9c0c776
- Updated enum values to be uppercase - Updated services to expose service models - Updated models to only export the mongoose model - Moved all mongoose static methods over to new services - Updated tests to refelct new setup BREAKING - Status that were uppercased (caps) have caused issues with the admin pages
21 lines
423 B
JavaScript
21 lines
423 B
JavaScript
const express = require('express');
|
|
const ActionsService = require('../../../services/actions');
|
|
|
|
const router = express.Router();
|
|
|
|
router.delete('/:action_id', (req, res, next) => {
|
|
ActionsService
|
|
.findOneAndRemove({
|
|
id: req.params.action_id,
|
|
user_id: req.user.id
|
|
})
|
|
.then(() => {
|
|
res.status(204).end();
|
|
})
|
|
.catch(error => {
|
|
next(error);
|
|
});
|
|
});
|
|
|
|
module.exports = router;
|