parent
cd7f0e3c24
commit
aa3b58433c
|
@ -38,7 +38,7 @@ module.exports = Self => {
|
|||
const [result] = response.result;
|
||||
const error = result.error_id;
|
||||
|
||||
if (senderFk) senderFk = ctx.req.accessToken.userId;
|
||||
if (senderFk) senderFk = senderFk.req.accessToken.userId;
|
||||
const newSms = {
|
||||
senderFk,
|
||||
destination: destination,
|
||||
|
|
|
@ -44,7 +44,7 @@ export default class Controller {
|
|||
cb: data => {
|
||||
if (this.method && this.code) {
|
||||
data.token && this.goToChangePassword(data);
|
||||
!data.token && this.goToLogin();
|
||||
if (!data.token) throw new UserError(`Credentials not valid`);
|
||||
} else
|
||||
this.handleCode(data.code);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ module.exports = Self => {
|
|||
|
||||
Self.sendSms = async(ctx, id, destination, message) => {
|
||||
const models = Self.app.models;
|
||||
const sms = await models.Sms.send(ctx, destination, message);
|
||||
const sms = await models.Sms.send(ctx, destination, message, {insert: true});
|
||||
|
||||
await models.ClientSms.create({
|
||||
clientFk: id,
|
||||
|
|
|
@ -30,7 +30,7 @@ module.exports = Self => {
|
|||
|
||||
const allSms = [];
|
||||
for (let client of targetClients) {
|
||||
let sms = await Self.app.models.Sms.send(ctx, client, message);
|
||||
let sms = await Self.app.models.Sms.send(ctx, client, message, {insert: true});
|
||||
allSms.push(sms);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ module.exports = Self => {
|
|||
|
||||
Self.sendSms = async(ctx, id, destination, message) => {
|
||||
const models = Self.app.models;
|
||||
const sms = await models.Sms.send(ctx, destination, message);
|
||||
const sms = await models.Sms.send(ctx, destination, message, {insert: true});
|
||||
const {clientFk} = await models.Ticket.findById(id);
|
||||
await models.ClientSms.create({
|
||||
clientFk,
|
||||
|
|
Loading…
Reference in New Issue