Skip to content

Commit

Permalink
bugfix: mailbox delete logic (#35)
Browse files Browse the repository at this point in the history
All mailboxes were getting deleted because the predicate always evaluated to true. Now only mailboxes with the `emails` array equal to `[]` get deleted.
  • Loading branch information
gcleaves authored Sep 26, 2020
1 parent 4715915 commit 92a96e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/app/serverapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ app.get('*.*', express.static(path.join(DIST_FOLDER, "browser")));
});
});

db.collection('mailboxes').remove({'emails': {$exists: true, $ne: '[]'}}, function (err, result) {
db.collection('mailboxes').remove({'emails': {$exists: true, $eq: []}}, function (err, result) {
if (err) {
logger.error(err);
} else {
Expand Down

0 comments on commit 92a96e7

Please sign in to comment.