bug sending messages to buyers fixed
gitea/salix/master This commit looks good Details
gitea/salix/test This commit looks good Details

This commit is contained in:
Gerard 2019-04-04 12:05:01 +02:00
parent bb039386f2
commit 9abaa8ce51
1 changed files with 12 additions and 3 deletions

View File

@ -73,7 +73,7 @@ module.exports = Self => {
await sendMessage(ctx, {
itemFk: sale.itemFk,
ticketFk: sale.ticketFk,
workerFk: sale.item().itemType().workerFk,
recipientFk: sale.item().itemType().worker().userFk,
quantity: sale.quantity,
concept: sale.concept,
nickname: address.nickname
@ -107,7 +107,16 @@ module.exports = Self => {
fields: ['typeFk'],
include: {
relation: 'itemType',
scope: {fields: ['workerFk']}
scope: {
fields: ['workerFk'],
include: {
relation: 'worker',
scope: {
fields: ['id', 'userFk'],
}
}
}
}
}
}],
@ -152,7 +161,7 @@ module.exports = Self => {
+ `"${params.nickname}" provenientes del ticket #${params.ticketFk}`;
await Self.app.models.Message.send(ctx, {
recipientFk: params.workerFk,
recipientFk: params.recipientFk,
message: message
}, {transaction: transaction});
}