@speakr/speakr-module-services
Version:
SPEAKR Shared Service Module
23 lines (16 loc) • 387 B
JavaScript
;
const db = require('../../db');
module.exports = {
byId
};
function byId(options) {
let where = { id: options.req.params.optout_id };
return db.optouts.destroy({ where })
.then(optouts => {
options.optouts = optouts;
return db.optouts.findOne({ where })
.then(optouts => {
return Promise.resolve(options);
});
})
}