Skip to content

Commit

Permalink
adiciona logs
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriqueAmorim20 committed Dec 9, 2023
1 parent 1181244 commit aaa091a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/rotina/rotina.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit aaa091a

Please sign in to comment.