fixed query

This commit is contained in:
Pau 2025-04-22 01:21:58 +02:00
parent 3b89082a92
commit 2cbb4a3a30
1 changed files with 4 additions and 3 deletions

View File

@ -22,7 +22,8 @@ const getReportTypesListQuery = ({ limit, page, ...rest }) =>
const countReportTypesListQuery = rest => const countReportTypesListQuery = rest =>
_coordinatesSelectQuery()({ count: 'COUNT(DISTINCT(rt.uuid)) AS count' })(rest); _coordinatesSelectQuery()({ count: 'COUNT(DISTINCT(rt.uuid)) AS count' })(rest);
const insertReportTypesQuery = () => { const insertReportTypesQuery = (createdBy) => {
const createdByCondition = createdBy ? ', :createdBy' : null;
return ` return `
INSERT INTO dbmaster.report_types ( INSERT INTO dbmaster.report_types (
uuid, uuid,
@ -33,8 +34,8 @@ const insertReportTypesQuery = () => {
VALUES ( VALUES (
:uuid, :uuid,
:name, :name,
:now, :now
:createdBy ${createdByCondition}
); );
SELECT * FROM dbmaster.report_types WHERE uuid = :uuid; SELECT * FROM dbmaster.report_types WHERE uuid = :uuid;
` `