@speakr/speakr-module-services
Version:
SPEAKR Shared Service Module
24 lines (18 loc) • 483 B
JavaScript
;
const db = require('../../db');
module.exports = function(options){
let where = {
influencer_id: options.influencers.id,
network_id: options.networks ? options.networks.id : { $not: null },
status: 'pending'
};
return db.invoices.update(options.update, { where })
.then(invoices => {
if (!!invoices) {
return Promise.resolve(options);
} else {
return Promise.reject(options);
}
}
);
};