Fixed mail api usage of the notifcations api

closes #10047

Requiring in the api module correctly wraps the notification api and
exposes it as a function.
This commit is contained in:
Fabien O'Carroll 2018-10-24 13:40:06 +07:00 committed by Rishabh Garg
parent 1c21153b85
commit 7fafa1e152

View File

@ -1,7 +1,7 @@
const Promise = require('bluebird'); const Promise = require('bluebird');
const common = require('../../lib/common'); const common = require('../../lib/common');
const mailService = require('../../services/mail'); const mailService = require('../../services/mail');
const notificationsAPI = require('./notifications'); const api = require('./');
let mailer; let mailer;
let _private = {}; let _private = {};
@ -12,7 +12,7 @@ _private.sendMail = (object) => {
return mailer.send(object.mail[0].message).catch((err) => { return mailer.send(object.mail[0].message).catch((err) => {
if (mailer.state.usingDirect) { if (mailer.state.usingDirect) {
notificationsAPI.add( api.notifications.add(
{ {
notifications: [{ notifications: [{
type: 'warn', type: 'warn',