@speakr/speakr-module-services
Version:
SPEAKR Shared Service Module
25 lines (21 loc) • 586 B
JavaScript
;
const db = require('../../db/');
module.exports = {
index
};
function index(options) {
const network_id = options.networks.id;
const where = { network_id };
return db.account_imports.findAll({
where,
order: 'id DESC'
}).then(account_imports => {
if(!account_imports) throw new Error(`Could not find account imports with id :: ${id}`)
options.account_imports = account_imports;
return Promise.resolve(options)
}).catch(err => Promise.reject({
code: 404,
message: 'Could not find Account Imports',
purpose: err.message
}))
}