fix send email
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-10-28 09:21:28 +02:00
parent e9731c4ac0
commit 9170c22d6f
3 changed files with 4 additions and 12 deletions

View File

@ -25,7 +25,6 @@ module.exports = Self => {
}); });
Self.sendCheckingPresence = async(ctx, recipientId, message, options) => { Self.sendCheckingPresence = async(ctx, recipientId, message, options) => {
console.log(ctx, recipientId, message, options);
if (!recipientId) return false; if (!recipientId) return false;
const myOptions = {}; const myOptions = {};
@ -39,10 +38,7 @@ module.exports = Self => {
const recipient = await models.Account.findById(recipientId, null, myOptions); const recipient = await models.Account.findById(recipientId, null, myOptions);
// Prevent sending messages to yourself // Prevent sending messages to yourself
console.log('llega');
console.log(recipientId, userId);
if (recipientId == userId) return false; if (recipientId == userId) return false;
console.log('llega2');
if (!recipient) if (!recipient)
throw new Error(`Could not send message "${message}" to worker id ${recipientId} from user ${userId}`); throw new Error(`Could not send message "${message}" to worker id ${recipientId} from user ${userId}`);

View File

@ -66,20 +66,16 @@ module.exports = Self => {
} }
} }
}); });
console.log(claim);
const message = $t('Claim pickup order sent', { const message = $t('Claim pickup order sent', {
claimId: args.id, claimId: args.id,
clientName: claim.client.name, clientName: claim.client().name,
claimUrl: `${origin}/#!/claim/${args.id}/summary`, claimUrl: `${origin}/#!/claim/${args.id}/summary`,
}); });
console.log(claim.client());
const salesPersonId = claim.client().salesPersonFk; const salesPersonId = claim.client().salesPersonFk;
if (claim.client().salesPersonFk) if (salesPersonId)
console.log(await models.Chat.sendCheckingPresence(ctx, 25, message)); await models.Chat.sendCheckingPresence(ctx, salesPersonId, message);
console.log(claim.client().salesPersonFk);
await models.ClaimLog.create({ await models.ClaimLog.create({
originFk: args.id, originFk: args.id,

View File

@ -13,7 +13,7 @@ module.exports = {
if (!this.ticket) if (!this.ticket)
throw new Error('Something went wrong'); throw new Error('Something went wrong');
console.log();
this.instructions = this.$t('description.instructions', [this.id, this.ticket.id]); this.instructions = this.$t('description.instructions', [this.id, this.ticket.id]);
}, },
methods: { methods: {