fixed naming

This commit is contained in:
Pau 2025-04-22 01:26:08 +02:00
parent 2cbb4a3a30
commit 8796f73578
2 changed files with 6 additions and 6 deletions

View File

@ -67,9 +67,9 @@ const getReportTypesByUuidController = (req, res, next, config) => {
const postReportTypesController = (req, res, next, config) => { const postReportTypesController = (req, res, next, config) => {
const conn = mysql.start(config); const conn = mysql.start(config);
const created_by = req.auth.user || null const createdBy = req.auth.user || null
insertReportTypesModel({ ...req.body, created_by, conn }) insertReportTypesModel({ ...req.body, createdBy, conn })
.then((response) => { .then((response) => {
const result = { const result = {
_data: { _data: {
@ -112,9 +112,9 @@ const putReportTypesController = (req, res, next, config) => {
const softDeleteReportTypesController = (req, res, next, config) => { const softDeleteReportTypesController = (req, res, next, config) => {
const conn = mysql.start(config); const conn = mysql.start(config);
const uuid_report_type = req.params.uuid; const uuid_report_type = req.params.uuid;
const deleted_by = req.auth.user || null const deletedBy = req.auth.user || null
softDeleteReportTypesModel({ uuid: uuid_report_type, deleted_by, conn }) softDeleteReportTypesModel({ uuid: uuid_report_type, deletedBy, conn })
.then(() => { .then(() => {
const result = {} const result = {}
next(result); next(result);

View File

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