UNPKG

@speakr/speakr-module-services

Version:
18 lines (15 loc) 344 B
"use strict"; const db = require('../../db'); module.exports = function (options) { let where = { $or: [ { parent_id:options.accounts.id }, { id: options.accounts.id } ] }; return db.accounts.destroy({ where: where }) .then(() => { delete options.accounts; return Promise.resolve(options) }); };