diff --git a/helpers/lotOccupancyDB/updateLotComment.js b/helpers/lotOccupancyDB/updateLotComment.js index 56f5de01..8aee2af7 100644 --- a/helpers/lotOccupancyDB/updateLotComment.js +++ b/helpers/lotOccupancyDB/updateLotComment.js @@ -1,6 +1,6 @@ import sqlite from "better-sqlite3"; import { lotOccupancyDB as databasePath } from "../../data/databasePaths.js"; -import { dateStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; +import { dateStringToInteger, timeStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; export const updateLotComment = (commentForm, requestSession) => { const rightNowMillis = Date.now(); const database = sqlite(databasePath); @@ -13,7 +13,7 @@ export const updateLotComment = (commentForm, requestSession) => { " recordUpdate_timeMillis = ?" + " where recordDelete_timeMillis is null" + " and lotCommentId = ?") - .run(dateStringToInteger(commentForm.lotCommentDateString), dateStringToInteger(commentForm.lotCommentTimeString), commentForm.lotComment, requestSession.user.userName, rightNowMillis, commentForm.lotCommentId); + .run(dateStringToInteger(commentForm.lotCommentDateString), timeStringToInteger(commentForm.lotCommentTimeString), commentForm.lotComment, requestSession.user.userName, rightNowMillis, commentForm.lotCommentId); database.close(); return result.changes > 0; }; diff --git a/helpers/lotOccupancyDB/updateLotComment.ts b/helpers/lotOccupancyDB/updateLotComment.ts index a4c355cf..de09f1bd 100644 --- a/helpers/lotOccupancyDB/updateLotComment.ts +++ b/helpers/lotOccupancyDB/updateLotComment.ts @@ -2,7 +2,7 @@ import sqlite from "better-sqlite3"; import { lotOccupancyDB as databasePath } from "../../data/databasePaths.js"; -import { dateStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; +import { dateStringToInteger, timeStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; import type * as recordTypes from "../../types/recordTypes"; @@ -34,7 +34,7 @@ export const updateLotComment = ( ) .run( dateStringToInteger(commentForm.lotCommentDateString), - dateStringToInteger(commentForm.lotCommentTimeString), + timeStringToInteger(commentForm.lotCommentTimeString), commentForm.lotComment, requestSession.user.userName, rightNowMillis, diff --git a/helpers/lotOccupancyDB/updateLotOccupancyComment.js b/helpers/lotOccupancyDB/updateLotOccupancyComment.js index 83e4663d..0d1cce81 100644 --- a/helpers/lotOccupancyDB/updateLotOccupancyComment.js +++ b/helpers/lotOccupancyDB/updateLotOccupancyComment.js @@ -1,6 +1,6 @@ import sqlite from "better-sqlite3"; import { lotOccupancyDB as databasePath } from "../../data/databasePaths.js"; -import { dateStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; +import { dateStringToInteger, timeStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; export const updateLotOccupancyComment = (commentForm, requestSession) => { const rightNowMillis = Date.now(); const database = sqlite(databasePath); @@ -13,7 +13,7 @@ export const updateLotOccupancyComment = (commentForm, requestSession) => { " recordUpdate_timeMillis = ?" + " where recordDelete_timeMillis is null" + " and lotOccupancyCommentId = ?") - .run(dateStringToInteger(commentForm.lotOccupancyCommentDateString), dateStringToInteger(commentForm.lotOccupancyCommentTimeString), commentForm.lotOccupancyComment, requestSession.user.userName, rightNowMillis, commentForm.lotOccupancyCommentId); + .run(dateStringToInteger(commentForm.lotOccupancyCommentDateString), timeStringToInteger(commentForm.lotOccupancyCommentTimeString), commentForm.lotOccupancyComment, requestSession.user.userName, rightNowMillis, commentForm.lotOccupancyCommentId); database.close(); return result.changes > 0; }; diff --git a/helpers/lotOccupancyDB/updateLotOccupancyComment.ts b/helpers/lotOccupancyDB/updateLotOccupancyComment.ts index 2cf570f1..76d48c34 100644 --- a/helpers/lotOccupancyDB/updateLotOccupancyComment.ts +++ b/helpers/lotOccupancyDB/updateLotOccupancyComment.ts @@ -2,7 +2,7 @@ import sqlite from "better-sqlite3"; import { lotOccupancyDB as databasePath } from "../../data/databasePaths.js"; -import { dateStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; +import { dateStringToInteger, timeStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; import type * as recordTypes from "../../types/recordTypes"; @@ -34,7 +34,7 @@ export const updateLotOccupancyComment = ( ) .run( dateStringToInteger(commentForm.lotOccupancyCommentDateString), - dateStringToInteger(commentForm.lotOccupancyCommentTimeString), + timeStringToInteger(commentForm.lotOccupancyCommentTimeString), commentForm.lotOccupancyComment, requestSession.user.userName, rightNowMillis, diff --git a/helpers/lotOccupancyDB/updateWorkOrderComment.js b/helpers/lotOccupancyDB/updateWorkOrderComment.js index 419a41a8..3c987eba 100644 --- a/helpers/lotOccupancyDB/updateWorkOrderComment.js +++ b/helpers/lotOccupancyDB/updateWorkOrderComment.js @@ -1,6 +1,6 @@ import sqlite from "better-sqlite3"; import { lotOccupancyDB as databasePath } from "../../data/databasePaths.js"; -import { dateStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; +import { dateStringToInteger, timeStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; export const updateWorkOrderComment = (commentForm, requestSession) => { const rightNowMillis = Date.now(); const database = sqlite(databasePath); @@ -13,7 +13,7 @@ export const updateWorkOrderComment = (commentForm, requestSession) => { " recordUpdate_timeMillis = ?" + " where recordDelete_timeMillis is null" + " and workOrderCommentId = ?") - .run(dateStringToInteger(commentForm.workOrderCommentDateString), dateStringToInteger(commentForm.workOrderCommentTimeString), commentForm.workOrderComment, requestSession.user.userName, rightNowMillis, commentForm.workOrderCommentId); + .run(dateStringToInteger(commentForm.workOrderCommentDateString), timeStringToInteger(commentForm.workOrderCommentTimeString), commentForm.workOrderComment, requestSession.user.userName, rightNowMillis, commentForm.workOrderCommentId); database.close(); return result.changes > 0; }; diff --git a/helpers/lotOccupancyDB/updateWorkOrderComment.ts b/helpers/lotOccupancyDB/updateWorkOrderComment.ts index e6584ac6..5545618c 100644 --- a/helpers/lotOccupancyDB/updateWorkOrderComment.ts +++ b/helpers/lotOccupancyDB/updateWorkOrderComment.ts @@ -2,7 +2,7 @@ import sqlite from "better-sqlite3"; import { lotOccupancyDB as databasePath } from "../../data/databasePaths.js"; -import { dateStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; +import { dateStringToInteger, timeStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; import type * as recordTypes from "../../types/recordTypes"; @@ -34,7 +34,7 @@ export const updateWorkOrderComment = ( ) .run( dateStringToInteger(commentForm.workOrderCommentDateString), - dateStringToInteger(commentForm.workOrderCommentTimeString), + timeStringToInteger(commentForm.workOrderCommentTimeString), commentForm.workOrderComment, requestSession.user.userName, rightNowMillis,