From 626355d251f396fa4213d5dabcc388e096412f64 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 4 Nov 2022 12:37:07 +0100 Subject: [PATCH] fix: sustituido insert por insert ignore --- .../worker/back/methods/worker-time-control/sendMail.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/worker/back/methods/worker-time-control/sendMail.js b/modules/worker/back/methods/worker-time-control/sendMail.js index 57f58ef22..1a57b5a05 100644 --- a/modules/worker/back/methods/worker-time-control/sendMail.js +++ b/modules/worker/back/methods/worker-time-control/sendMail.js @@ -350,11 +350,9 @@ module.exports = Self => { body: `${salix.url}worker/${previousWorkerFk}/time-control?timestamp=${timestamp}` }, myOptions); - // await models.WorkerTimeControlMail.create({ - // workerFk: previousWorkerFk, - // week: args.week, - // year: args.year - // }, myOptions); + query = `INSERT IGNORE INTO workerTimeControlMail (workerFk, year, week) + VALUES (?, ?, ?);`; + await Self.rawSql(query, [previousWorkerFk, args.year, args.week], myOptions); previousWorkerFk = day.workerFk; previousReceiver = day.receiver;