UNPKG

@speakr/speakr-module-services

Version:
22 lines (20 loc) 602 B
"use strict"; const db = require('../../db'); module.exports = { byId: byId }; function byId(options) { const impression = options.impression; const body = options.req.body; return impression.updateAttributes(body) .then(updated => { if(!updated) throw new Error(`Failure to Update Engagement :: ${impression}`); options.engagment = updated; return options; }) .catch(err => Promise.reject({ code: 409, message: 'Failure to Update Impression', purpose: err.message })) }