feat(Salix): refs #6427 #6427 add option parameter

This commit is contained in:
Javier Segarra 2024-06-14 15:53:58 +02:00
parent cd7f0e3c24
commit aa3b58433c
5 changed files with 5 additions and 5 deletions

View File

@ -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,

View File

@ -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);
}

View File

@ -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,

View File

@ -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);
}

View File

@ -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,