mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 10:30:00 +08:00
21 lines
404 B
JavaScript
21 lines
404 B
JavaScript
const express = require('express');
|
|
const Action = require('../../../models/action');
|
|
|
|
const router = express.Router();
|
|
|
|
router.delete('/:action_id', (req, res, next) => {
|
|
Action
|
|
.findOneAndRemove({
|
|
id: req.params.action_id,
|
|
user_id: req.user.id
|
|
})
|
|
.then(() => {
|
|
res.status(204).end();
|
|
})
|
|
.catch(error => {
|
|
next(error);
|
|
});
|
|
});
|
|
|
|
module.exports = router;
|