diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js index a79fe44186..9411b95e55 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/back/methods/imap-time-control/checkInbox.js @@ -1,5 +1,4 @@ const Imap = require('imap'); -const {NULL} = require('node-sass'); module.exports = Self => { Self.remoteMethod('checkInbox', { description: 'Check an email inbox and process it', @@ -91,7 +90,6 @@ module.exports = Self => { }; async function emailConfirm(buffer) { - console.log('buffer', buffer); const now = new Date(); const from = JSON.stringify(Imap.parseHeader(buffer).from); const subject = JSON.stringify(Imap.parseHeader(buffer).subject); @@ -102,7 +100,7 @@ module.exports = Self => { const user = await getUser(from); let workerMail; - if (user.id != NULL) { + if (user.id != null) { workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ where: { week: week, @@ -111,7 +109,7 @@ module.exports = Self => { } }); } - if (workerMail != NULL) { + if (workerMail != null) { await workerMail.updateAttributes({ updated: now, state: 'CONFIRMED' @@ -120,8 +118,6 @@ module.exports = Self => { } async function emailReply(buffer, emailBody) { - console.log('buffer', buffer); - console.log('emailBody', emailBody); const now = new Date(); const from = JSON.stringify(Imap.parseHeader(buffer).from); const subject = JSON.stringify(Imap.parseHeader(buffer).subject); @@ -132,7 +128,7 @@ module.exports = Self => { const user = await getUser(from); let workerMail; - if (user.id != NULL) { + if (user.id != null) { workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ where: { week: week, @@ -141,7 +137,7 @@ module.exports = Self => { } }); - if (workerMail != NULL) { + if (workerMail != null) { await workerMail.updateAttributes({ updated: now, state: 'REVISE',