UNPKG

@speakr/speakr-module-services

Version:
26 lines (20 loc) 470 B
"use strict"; const db = require('../../db'); module.exports = { byIdHash }; function byIdHash(options) { let where = { id_hash: options.req.params.id_hash }; return db.contacts.destroy({where}) .then((contacts) => { return db.contacts.findOne({where}) .then((contacts) => { options.contacts = contacts; return Promise.resolve(options) }); }).catch((err) => { return Promise.reject(err) }); }