From 587da840c0653d0b75f38fc971b6454da0fa6211 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 7 Oct 2022 12:16:30 +0200 Subject: [PATCH 1/2] Fix --- .../back/methods/client/consumptionSendQueued.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/client/back/methods/client/consumptionSendQueued.js b/modules/client/back/methods/client/consumptionSendQueued.js index 74ccf164d..77e0e34f2 100644 --- a/modules/client/back/methods/client/consumptionSendQueued.js +++ b/modules/client/back/methods/client/consumptionSendQueued.js @@ -54,14 +54,14 @@ module.exports = Self => { const email = new Email('campaign-metrics', args); await email.send(); - - await Self.rawSql(` - UPDATE clientConsumptionQueue - SET status = 'printed', - printed = ? - WHERE id = ?`, - [new Date(), queue.id]); } + + await Self.rawSql(` + UPDATE clientConsumptionQueue + SET status = 'printed', + printed = ? + WHERE id = ?`, + [new Date(), queue.id]); } catch (error) { await Self.rawSql(` UPDATE clientConsumptionQueue From 3dee50a796a0e8c5ad792623ea63eb3d04070242 Mon Sep 17 00:00:00 2001 From: joan Date: Sun, 9 Oct 2022 20:14:14 +0200 Subject: [PATCH 2/2] Updated method accessType --- modules/claim/back/methods/claim/claimPickupEmail.js | 5 +++-- modules/route/back/methods/route/driverRouteEmail.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/claim/back/methods/claim/claimPickupEmail.js b/modules/claim/back/methods/claim/claimPickupEmail.js index b946353d6..4d64cc66e 100644 --- a/modules/claim/back/methods/claim/claimPickupEmail.js +++ b/modules/claim/back/methods/claim/claimPickupEmail.js @@ -1,8 +1,9 @@ -const {Report, Email, smtp} = require('vn-print'); +const {Email} = require('vn-print'); module.exports = Self => { Self.remoteMethodCtx('claimPickupEmail', { description: 'Sends the the claim pickup order email with an attached PDF', + accessType: 'WRITE', accepts: [ { arg: 'id', @@ -40,7 +41,7 @@ module.exports = Self => { } }); - Self.claimPickupEmail = async(ctx, id) => { + Self.claimPickupEmail = async ctx => { const args = Object.assign({}, ctx.args); const params = { recipient: args.recipient, diff --git a/modules/route/back/methods/route/driverRouteEmail.js b/modules/route/back/methods/route/driverRouteEmail.js index 81d770360..4d5279d2d 100644 --- a/modules/route/back/methods/route/driverRouteEmail.js +++ b/modules/route/back/methods/route/driverRouteEmail.js @@ -3,6 +3,7 @@ const {Email} = require('vn-print'); module.exports = Self => { Self.remoteMethodCtx('driverRouteEmail', { description: 'Sends the driver route email with an attached PDF', + accessType: 'WRITE', accepts: [ { arg: 'id',