@speakr/speakr-module-services
Version:
SPEAKR Shared Service Module
36 lines (31 loc) • 873 B
JavaScript
;
const db = require('../../db/');
module.exports = {
byId
};
function byId(options) {
// if(options.req.device.type == 'mobile' && option.params.device.id) {
// let where = {
// id: options.params.device.id
// };
// return db.devices.findOne({where})
// .then((devices) => {
// if (!!devices) {
// options.user.device = devices;
// return options;
// } else {
// options.user.device = null;
// return options;
// }
// });
// }
// else {
// options.user.device.type = options.req.device.type;
// options.user.device.id = null;
// console.log("Heyooooo >>>>>> ", options.user.device.type);
// return Promise.resolve(options);
// }
options.user.device.type = options.req.device.type;
options.user.device.id = null;
return options;
}