Bugfix showing correct amount of deleted asset/banner on board, deletedCount->modifiedCount because we are updating board object not deleting a document

indiachan-spamvector
Thomas Lynch 2 years ago
parent 2bab64e3fb
commit cc2eefc477
  1. 2
      models/forms/deleteassets.js
  2. 2
      models/forms/deletebanners.js

@ -16,7 +16,7 @@ module.exports = async (req, res) => {
}));
//remove from db
const amount = await Boards.removeAssets(req.params.board, req.body.checkedassets).then(result => result.deletedCount);
const amount = await Boards.removeAssets(req.params.board, req.body.checkedassets).then(result => result.modifiedCount);
//update res locals assets in memory
res.locals.board.assets = res.locals.board.assets.filter(asset => {

@ -17,7 +17,7 @@ module.exports = async (req, res) => {
}));
//remove from db
const amount = await Boards.removeBanners(req.params.board, req.body.checkedbanners).then(result => result.deletedCount);
const amount = await Boards.removeBanners(req.params.board, req.body.checkedbanners).then(result => result.modifiedCount);
//update res locals banners in memory
res.locals.board.banners = res.locals.board.banners.filter(banner => {

Loading…
Cancel
Save