Skip to content

Commit

Permalink
fix createAsync wrapper, strict ordering. Settings handler remove unn…
Browse files Browse the repository at this point in the history
…ecessary second param
  • Loading branch information
NickOvt committed Oct 23, 2023
1 parent 61645e4 commit c389ea6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mailbox-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MailboxHandler {

create(user, path, opts, callback) {
this.createAsync(user, path, opts)
.then(mailboxData => callback(null, ...Object.values(mailboxData)))
.then(mailboxData => callback(null, ...[mailboxData.status, mailboxData.id]))
.catch(err => callback(err));
}

Expand All @@ -51,7 +51,7 @@ class MailboxHandler {

const mailboxCountForUser = await this.database.collection('mailboxes').countDocuments({ user });

if (mailboxCountForUser > (await this.settingsHandler.get('const:max:mailboxes', {}))) {
if (mailboxCountForUser > (await this.settingsHandler.get('const:max:mailboxes'))) {
const err = new Error('Mailbox creation failed with code ReachedMailboxCountLimit. Max mailboxes count reached.');
err.code = 'CANNOT';
err.responseCode = 400;
Expand Down

0 comments on commit c389ea6

Please sign in to comment.