mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-11 14:53:55 +08:00
Changed config api. Split config controllers into separate files. Split bookmarks controllers into separate files
This commit is contained in:
18
controllers/bookmarks/deleteBookmark.js
Normal file
18
controllers/bookmarks/deleteBookmark.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const asyncWrapper = require('../../middleware/asyncWrapper');
|
||||
const Bookmark = require('../../models/Bookmark');
|
||||
|
||||
// @desc Delete bookmark
|
||||
// @route DELETE /api/bookmarks/:id
|
||||
// @access Public
|
||||
const deleteBookmark = asyncWrapper(async (req, res, next) => {
|
||||
await Bookmark.destroy({
|
||||
where: { id: req.params.id },
|
||||
});
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
data: {},
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = deleteBookmark;
|
||||
Reference in New Issue
Block a user