From aaa091af5aeaa2534e74004bbee4753f07e1ee9f Mon Sep 17 00:00:00 2001 From: Henrique Melo Date: Sat, 9 Dec 2023 19:49:07 -0300 Subject: [PATCH] adiciona logs --- src/rotina/rotina.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rotina/rotina.service.ts b/src/rotina/rotina.service.ts index a0387f2..d1192fd 100644 --- a/src/rotina/rotina.service.ts +++ b/src/rotina/rotina.service.ts @@ -111,11 +111,13 @@ export class RotinaService { const startString = `${dataString}T00:00:00.000Z`; const endString = `${dataString}T23:59:59.000Z`; + const where = `"notificacao" = ${true} AND (("dataHora"::date BETWEEN '${startString}'::date AND '${endString}'::date) OR (dias && '{${weekday}}'::rotina_dias_enum[])) AND lpad(date_part('hour', "dataHora")::text, 2, '0') || ':' || lpad(date_part('minute', "dataHora")::text, 2, '0') = '${hora}'`; + + console.log(where); + return this._repository .createQueryBuilder('rotinas') - .where( - `"notificacao" = ${true} AND (("dataHora"::date BETWEEN '${startString}'::date AND '${endString}'::date) OR (dias && '{${weekday}}'::rotina_dias_enum[])) AND lpad(date_part('hour', "dataHora")::text, 2, '0') || ':' || lpad(date_part('minute', "dataHora")::text, 2, '0') = '${hora}'`, - ) + .where(where) .getMany(); } }