You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
578 B
JavaScript
19 lines
578 B
JavaScript
9 months ago
|
'use strict';
|
||
|
|
||
|
const db = require('../config').database;
|
||
|
const { domain, name } = require('../config').server;
|
||
|
const initModels = require('../models/init-models');
|
||
|
|
||
|
const Sequelize = db.sequelize;
|
||
|
const models = initModels(Sequelize);
|
||
|
|
||
|
const OutboundModelModel = models.outbound_messages;
|
||
|
|
||
|
const upsertOutboundMessage = async data => {
|
||
|
// const r = await OutboundModelModel.create({ ...data });
|
||
|
const [instance, created] = await OutboundModelModel.upsert({ ...data }, { returning: true });
|
||
|
return created;
|
||
|
};
|
||
|
|
||
|
module.exports = { upsertOutboundMessage };
|