fix time saving

deepsource-autofix-76c6eb20
Dan Gowans 2022-10-04 13:58:32 -04:00
parent bcb238d675
commit 7531c1bd56
6 changed files with 12 additions and 12 deletions

View File

@ -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;
};

View File

@ -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,

View File

@ -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;
};

View File

@ -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,

View File

@ -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;
};

View File

@ -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,