log tiquet request

This commit is contained in:
Bernat Exposito Domenech 2020-05-27 08:07:14 +02:00
parent 731e411cf8
commit 8be929c1da
1 changed files with 15 additions and 0 deletions

View File

@ -31,6 +31,7 @@ module.exports = Self => {
});
Self.confirm = async ctx => {
const userId = ctx.req.accessToken.userId;
const models = Self.app.models;
const tx = await Self.beginTransaction({});
const $t = ctx.req.__; // $translate
@ -92,6 +93,20 @@ module.exports = Self => {
});
await models.Chat.sendCheckingPresence(ctx, requesterId, message);
// loguejar
let logRecord = {
originFk: sale.ticketFk,
userFk: userId,
action: 'update',
changedModel: 'ticketRequest',
newInstance: {
destinationFk: sale.ticketFk,
message: message
}
};
await Self.app.models.TicketLog.create(logRecord);
await tx.commit();
return sale;