diff --git a/handlers/print-get/pdf.d.ts b/handlers/print-get/pdf.d.ts index fea40ba9..58dff6d0 100644 --- a/handlers/print-get/pdf.d.ts +++ b/handlers/print-get/pdf.d.ts @@ -1,3 +1,3 @@ -import type { Request, Response } from 'express'; -export declare function handler(request: Request, response: Response, next: any): Promise; +import type { Request, Response, NextFunction } from 'express'; +export declare function handler(request: Request, response: Response, next: NextFunction): Promise; export default handler; diff --git a/handlers/print-get/pdf.js b/handlers/print-get/pdf.js index 9da0b714..24bd3783 100644 --- a/handlers/print-get/pdf.js +++ b/handlers/print-get/pdf.js @@ -20,7 +20,7 @@ export async function handler(request, response, next) { return; } const printConfig = getPdfPrintConfig(printName); - if (!printConfig) { + if (printConfig === undefined) { response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + '/dashboard/?error=printConfigNotFound'); return; diff --git a/handlers/print-get/pdf.ts b/handlers/print-get/pdf.ts index 1d24f70a..a4e708e7 100644 --- a/handlers/print-get/pdf.ts +++ b/handlers/print-get/pdf.ts @@ -1,4 +1,4 @@ -import type { Request, Response } from 'express' +import type { Request, Response, NextFunction } from 'express' import path from 'node:path' import * as ejs from 'ejs' @@ -22,7 +22,7 @@ const attachmentOrInline = configFunctions.getProperty( export async function handler( request: Request, response: Response, - next + next: NextFunction ): Promise { const printName = request.params.printName @@ -43,7 +43,7 @@ export async function handler( const printConfig = getPdfPrintConfig(printName) - if (!printConfig) { + if (printConfig === undefined) { response.redirect( configFunctions.getProperty('reverseProxy.urlPrefix') + '/dashboard/?error=printConfigNotFound' @@ -58,7 +58,7 @@ export async function handler( function pdfCallbackFunction(pdf: Buffer): void { response.setHeader( 'Content-Disposition', - `${attachmentOrInline}; filename=${camelcase(printConfig.title)}.pdf` + `${attachmentOrInline}; filename=${camelcase(printConfig!.title)}.pdf` ) response.setHeader('Content-Type', 'application/pdf') diff --git a/handlers/print-get/screen.js b/handlers/print-get/screen.js index ef354b8b..72d54225 100644 --- a/handlers/print-get/screen.js +++ b/handlers/print-get/screen.js @@ -13,7 +13,7 @@ export async function handler(request, response) { return; } const printConfig = getScreenPrintConfig(printName); - if (!printConfig) { + if (printConfig === undefined) { response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + '/dashboard/?error=printConfigNotFound'); return; diff --git a/handlers/print-get/screen.ts b/handlers/print-get/screen.ts index 1ce23c07..eca73951 100644 --- a/handlers/print-get/screen.ts +++ b/handlers/print-get/screen.ts @@ -29,7 +29,7 @@ export async function handler( const printConfig = getScreenPrintConfig(printName) - if (!printConfig) { + if (printConfig === undefined) { response.redirect( configFunctions.getProperty('reverseProxy.urlPrefix') + '/dashboard/?error=printConfigNotFound' diff --git a/handlers/reports-get/reportName.js b/handlers/reports-get/reportName.js index a4fe92e9..e4da3825 100644 --- a/handlers/reports-get/reportName.js +++ b/handlers/reports-get/reportName.js @@ -9,7 +9,7 @@ export async function handler(request, response) { break; } } - if (!rows) { + if (rows === undefined) { response.status(404).json({ success: false, message: 'Report Not Found' diff --git a/handlers/reports-get/reportName.ts b/handlers/reports-get/reportName.ts index 8bb19639..808f9041 100644 --- a/handlers/reports-get/reportName.ts +++ b/handlers/reports-get/reportName.ts @@ -22,7 +22,7 @@ export async function handler( } } - if (!rows) { + if (rows === undefined) { response.status(404).json({ success: false, message: 'Report Not Found' diff --git a/helpers/functions.print.d.ts b/helpers/functions.print.d.ts index e2caf1cf..200e8d25 100644 --- a/helpers/functions.print.d.ts +++ b/helpers/functions.print.d.ts @@ -2,8 +2,8 @@ interface PrintConfig { title: string; params: string[]; } -export declare function getScreenPrintConfig(printName: string): PrintConfig; -export declare function getPdfPrintConfig(printName: string): PrintConfig; +export declare function getScreenPrintConfig(printName: string): PrintConfig | undefined; +export declare function getPdfPrintConfig(printName: string): PrintConfig | undefined; export declare function getPrintConfig(screenOrPdfPrintName: string): PrintConfig | undefined; export declare function getReportData(printConfig: PrintConfig, requestQuery: Record): Promise>; export {}; diff --git a/helpers/functions.print.ts b/helpers/functions.print.ts index eea42f18..2960ca90 100644 --- a/helpers/functions.print.ts +++ b/helpers/functions.print.ts @@ -18,7 +18,7 @@ const screenPrintConfigs: Record = { } } -export function getScreenPrintConfig(printName: string): PrintConfig { +export function getScreenPrintConfig(printName: string): PrintConfig | undefined { return screenPrintConfigs[printName] } @@ -43,7 +43,7 @@ const pdfPrintConfigs: Record = { } } -export function getPdfPrintConfig(printName: string): PrintConfig { +export function getPdfPrintConfig(printName: string): PrintConfig | undefined { return pdfPrintConfigs[printName] } diff --git a/helpers/functions.user.js b/helpers/functions.user.js index aa3b39c9..254cd926 100644 --- a/helpers/functions.user.js +++ b/helpers/functions.user.js @@ -1,26 +1,18 @@ import { getUserNameFromApiKey } from './functions.api.js'; import * as configFunctions from './functions.config.js'; export function userIsAdmin(request) { - const user = request.session?.user; - if (!user?.userProperties) { - return false; - } - return user.userProperties.isAdmin; + return request.session?.user?.userProperties?.isAdmin ?? false; } export function userCanUpdate(request) { - const user = request.session?.user; - if (!user?.userProperties) { - return false; - } - return user.userProperties.canUpdate; + return request.session?.user?.userProperties?.canUpdate ?? false; } export async function apiKeyIsValid(request) { const apiKey = request.params?.apiKey; - if (!apiKey) { + if (apiKey === undefined) { return false; } const userName = await getUserNameFromApiKey(apiKey); - if (!userName) { + if (userName === undefined) { return false; } const canLogin = configFunctions diff --git a/helpers/functions.user.ts b/helpers/functions.user.ts index 70b650c4..dad2e56f 100644 --- a/helpers/functions.user.ts +++ b/helpers/functions.user.ts @@ -16,35 +16,23 @@ export interface APIRequest { } export function userIsAdmin(request: UserRequest): boolean { - const user = request.session?.user - - if (!user?.userProperties) { - return false - } - - return user.userProperties.isAdmin + return request.session?.user?.userProperties?.isAdmin ?? false } export function userCanUpdate(request: UserRequest): boolean { - const user = request.session?.user - - if (!user?.userProperties) { - return false - } - - return user.userProperties.canUpdate + return request.session?.user?.userProperties?.canUpdate ?? false } export async function apiKeyIsValid(request: APIRequest): Promise { const apiKey = request.params?.apiKey - if (!apiKey) { + if (apiKey === undefined) { return false } const userName = await getUserNameFromApiKey(apiKey) - if (!userName) { + if (userName === undefined) { return false } diff --git a/helpers/lotOccupancyDB/moveFee.js b/helpers/lotOccupancyDB/moveFee.js index 1f49b8c4..8dd266ea 100644 --- a/helpers/lotOccupancyDB/moveFee.js +++ b/helpers/lotOccupancyDB/moveFee.js @@ -61,10 +61,10 @@ export async function moveFeeUpToTop(feeId) { updateRecordOrderNumber('Fees', feeId, -1, database); database .prepare(`update Fees - set orderNumber = orderNumber + 1 - where recordDelete_timeMillis is null - and feeCategoryId = ? - and orderNumber < ?`) + set orderNumber = orderNumber + 1 + where recordDelete_timeMillis is null + and feeCategoryId = ? + and orderNumber < ?`) .run(currentFee.feeCategoryId, currentFee.orderNumber); } database.release(); diff --git a/helpers/lotOccupancyDB/moveFee.ts b/helpers/lotOccupancyDB/moveFee.ts index 94072b58..53e65c29 100644 --- a/helpers/lotOccupancyDB/moveFee.ts +++ b/helpers/lotOccupancyDB/moveFee.ts @@ -107,10 +107,10 @@ export async function moveFeeUpToTop(feeId: number | string): Promise { database .prepare( `update Fees - set orderNumber = orderNumber + 1 - where recordDelete_timeMillis is null - and feeCategoryId = ? - and orderNumber < ?` + set orderNumber = orderNumber + 1 + where recordDelete_timeMillis is null + and feeCategoryId = ? + and orderNumber < ?` ) .run(currentFee.feeCategoryId, currentFee.orderNumber) } diff --git a/helpers/lotOccupancyDB/moveLotTypeField.js b/helpers/lotOccupancyDB/moveLotTypeField.js index 17d5a42e..d559339d 100644 --- a/helpers/lotOccupancyDB/moveLotTypeField.js +++ b/helpers/lotOccupancyDB/moveLotTypeField.js @@ -34,10 +34,10 @@ export async function moveLotTypeFieldDownToBottom(lotTypeFieldId) { updateRecordOrderNumber('LotTypeFields', lotTypeFieldId, maxOrderNumber + 1, database); database .prepare(`update LotTypeFields - set orderNumber = orderNumber - 1 - where recordDelete_timeMillis is null - and lotTypeId = ? - and orderNumber > ?`) + set orderNumber = orderNumber - 1 + where recordDelete_timeMillis is null + and lotTypeId = ? + and orderNumber > ?`) .run(currentField.lotTypeId, currentField.orderNumber); } database.release(); diff --git a/helpers/lotOccupancyDB/moveLotTypeField.ts b/helpers/lotOccupancyDB/moveLotTypeField.ts index 5ae62df9..b23fb9b0 100644 --- a/helpers/lotOccupancyDB/moveLotTypeField.ts +++ b/helpers/lotOccupancyDB/moveLotTypeField.ts @@ -73,10 +73,10 @@ export async function moveLotTypeFieldDownToBottom( database .prepare( `update LotTypeFields - set orderNumber = orderNumber - 1 - where recordDelete_timeMillis is null - and lotTypeId = ? - and orderNumber > ?` + set orderNumber = orderNumber - 1 + where recordDelete_timeMillis is null + and lotTypeId = ? + and orderNumber > ?` ) .run(currentField.lotTypeId, currentField.orderNumber) } diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js b/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js index 969b78ec..40583e5b 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js +++ b/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js @@ -26,23 +26,23 @@ export async function moveOccupancyTypePrintDownToBottom(occupancyTypeId, printE .get(occupancyTypeId, printEJS).orderNumber; const maxOrderNumber = database .prepare(`select max(orderNumber) as maxOrderNumber - from OccupancyTypePrints - where recordDelete_timeMillis is null - and occupancyTypeId = ?`) + from OccupancyTypePrints + where recordDelete_timeMillis is null + and occupancyTypeId = ?`) .get(occupancyTypeId).maxOrderNumber; if (currentOrderNumber !== maxOrderNumber) { database .prepare(`update OccupancyTypePrints - set orderNumber = ? + 1 - where occupancyTypeId = ? - and printEJS = ?`) + set orderNumber = ? + 1 + where occupancyTypeId = ? + and printEJS = ?`) .run(maxOrderNumber, occupancyTypeId, printEJS); database .prepare(`update OccupancyTypeFields - set orderNumber = orderNumber - 1 - where recordDelete_timeMillis is null - and occupancyTypeId = ? - and orderNumber > ?`) + set orderNumber = orderNumber - 1 + where recordDelete_timeMillis is null + and occupancyTypeId = ? + and orderNumber > ?`) .run(occupancyTypeId, currentOrderNumber); } database.release(); diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.ts b/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.ts index 1fb62b4c..95f5b61e 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.ts +++ b/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.ts @@ -52,9 +52,9 @@ export async function moveOccupancyTypePrintDownToBottom( const maxOrderNumber: number = database .prepare( `select max(orderNumber) as maxOrderNumber - from OccupancyTypePrints - where recordDelete_timeMillis is null - and occupancyTypeId = ?` + from OccupancyTypePrints + where recordDelete_timeMillis is null + and occupancyTypeId = ?` ) .get(occupancyTypeId).maxOrderNumber @@ -62,19 +62,19 @@ export async function moveOccupancyTypePrintDownToBottom( database .prepare( `update OccupancyTypePrints - set orderNumber = ? + 1 - where occupancyTypeId = ? - and printEJS = ?` + set orderNumber = ? + 1 + where occupancyTypeId = ? + and printEJS = ?` ) .run(maxOrderNumber, occupancyTypeId, printEJS) database .prepare( `update OccupancyTypeFields - set orderNumber = orderNumber - 1 - where recordDelete_timeMillis is null - and occupancyTypeId = ? - and orderNumber > ?` + set orderNumber = orderNumber - 1 + where recordDelete_timeMillis is null + and occupancyTypeId = ? + and orderNumber > ?` ) .run(occupancyTypeId, currentOrderNumber) } diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js b/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js index edd8b0a4..317559d1 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js +++ b/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js @@ -31,16 +31,16 @@ export async function moveOccupancyTypePrintUpToTop(occupancyTypeId, printEJS) { if (currentOrderNumber > 0) { database .prepare(`update OccupancyTypePrints - set orderNumber = -1 - where occupancyTypeId = ? - and printEJS = ?`) + set orderNumber = -1 + where occupancyTypeId = ? + and printEJS = ?`) .run(occupancyTypeId, printEJS); database .prepare(`update OccupancyTypePrints - set orderNumber = orderNumber + 1 - where recordDelete_timeMillis is null - and occupancyTypeId = ? - and orderNumber < ?`) + set orderNumber = orderNumber + 1 + where recordDelete_timeMillis is null + and occupancyTypeId = ? + and orderNumber < ?`) .run(occupancyTypeId, currentOrderNumber); } database.release(); diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.ts b/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.ts index e0395532..c4270d04 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.ts +++ b/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.ts @@ -58,19 +58,19 @@ export async function moveOccupancyTypePrintUpToTop( database .prepare( `update OccupancyTypePrints - set orderNumber = -1 - where occupancyTypeId = ? - and printEJS = ?` + set orderNumber = -1 + where occupancyTypeId = ? + and printEJS = ?` ) .run(occupancyTypeId, printEJS) database .prepare( `update OccupancyTypePrints - set orderNumber = orderNumber + 1 - where recordDelete_timeMillis is null - and occupancyTypeId = ? - and orderNumber < ?` + set orderNumber = orderNumber + 1 + where recordDelete_timeMillis is null + and occupancyTypeId = ? + and orderNumber < ?` ) .run(occupancyTypeId, currentOrderNumber) } diff --git a/helpers/lotOccupancyDB/moveRecord.js b/helpers/lotOccupancyDB/moveRecord.js index ed28bd44..85b045e2 100644 --- a/helpers/lotOccupancyDB/moveRecord.js +++ b/helpers/lotOccupancyDB/moveRecord.js @@ -12,8 +12,8 @@ recordIdColumns.set('WorkOrderTypes', 'workOrderTypeId'); function getCurrentOrderNumber(recordTable, recordId, database) { const currentOrderNumber = database .prepare(`select orderNumber - from ${recordTable} - where ${recordIdColumns.get(recordTable)} = ?`) + from ${recordTable} + where ${recordIdColumns.get(recordTable)} = ?`) .get(recordId).orderNumber; return currentOrderNumber; } @@ -43,9 +43,9 @@ export async function moveRecordDownToBottom(recordTable, recordId) { updateRecordOrderNumber(recordTable, recordId, maxOrderNumber + 1, database); database .prepare(`update ${recordTable} - set orderNumber = orderNumber - 1 - where recordDelete_timeMillis is null - and orderNumber > ?`) + set orderNumber = orderNumber - 1 + where recordDelete_timeMillis is null + and orderNumber > ?`) .run(currentOrderNumber); } database.release(); @@ -77,9 +77,9 @@ export async function moveRecordUpToTop(recordTable, recordId) { updateRecordOrderNumber(recordTable, recordId, -1, database); database .prepare(`update ${recordTable} - set orderNumber = orderNumber + 1 - where recordDelete_timeMillis is null - and orderNumber < ?`) + set orderNumber = orderNumber + 1 + where recordDelete_timeMillis is null + and orderNumber < ?`) .run(currentOrderNumber); } database.release(); diff --git a/helpers/lotOccupancyDB/moveRecord.ts b/helpers/lotOccupancyDB/moveRecord.ts index 60083b8a..463f6467 100644 --- a/helpers/lotOccupancyDB/moveRecord.ts +++ b/helpers/lotOccupancyDB/moveRecord.ts @@ -13,7 +13,7 @@ type RecordTable = | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes' -const recordIdColumns: Map = new Map() +const recordIdColumns = new Map() recordIdColumns.set('FeeCategories', 'feeCategoryId') recordIdColumns.set('LotOccupantTypes', 'lotOccupantTypeId') recordIdColumns.set('LotStatuses', 'lotStatusId') @@ -30,8 +30,8 @@ function getCurrentOrderNumber( const currentOrderNumber: number = database .prepare( `select orderNumber - from ${recordTable} - where ${recordIdColumns.get(recordTable)!} = ?` + from ${recordTable} + where ${recordIdColumns.get(recordTable)!} = ?` ) .get(recordId).orderNumber @@ -99,9 +99,9 @@ export async function moveRecordDownToBottom( database .prepare( `update ${recordTable} - set orderNumber = orderNumber - 1 - where recordDelete_timeMillis is null - and orderNumber > ?` + set orderNumber = orderNumber - 1 + where recordDelete_timeMillis is null + and orderNumber > ?` ) .run(currentOrderNumber) } @@ -171,9 +171,9 @@ export async function moveRecordUpToTop( database .prepare( `update ${recordTable} - set orderNumber = orderNumber + 1 - where recordDelete_timeMillis is null - and orderNumber < ?` + set orderNumber = orderNumber + 1 + where recordDelete_timeMillis is null + and orderNumber < ?` ) .run(currentOrderNumber) } diff --git a/helpers/lotOccupancyDB/updateLot.js b/helpers/lotOccupancyDB/updateLot.js index 66110d8c..b73497cd 100644 --- a/helpers/lotOccupancyDB/updateLot.js +++ b/helpers/lotOccupancyDB/updateLot.js @@ -22,13 +22,13 @@ export async function updateLot(lotForm, requestSession) { const lotTypeFieldIds = (lotForm.lotTypeFieldIds ?? '').split(','); for (const lotTypeFieldId of lotTypeFieldIds) { const lotFieldValue = lotForm['lotFieldValue_' + lotTypeFieldId]; - await (lotFieldValue && lotFieldValue !== '' - ? addOrUpdateLotField({ + await ((lotFieldValue ?? '') === '' + ? deleteLotField(lotForm.lotId, lotTypeFieldId, requestSession, database) + : addOrUpdateLotField({ lotId: lotForm.lotId, lotTypeFieldId, - lotFieldValue - }, requestSession, database) - : deleteLotField(lotForm.lotId, lotTypeFieldId, requestSession, database)); + lotFieldValue: lotFieldValue + }, requestSession, database)); } } database.release(); diff --git a/helpers/lotOccupancyDB/updateLot.ts b/helpers/lotOccupancyDB/updateLot.ts index acc6070e..15daa98a 100644 --- a/helpers/lotOccupancyDB/updateLot.ts +++ b/helpers/lotOccupancyDB/updateLot.ts @@ -62,21 +62,23 @@ export async function updateLot( const lotTypeFieldIds = (lotForm.lotTypeFieldIds ?? '').split(',') for (const lotTypeFieldId of lotTypeFieldIds) { - const lotFieldValue = lotForm['lotFieldValue_' + lotTypeFieldId] as string + const lotFieldValue = lotForm['lotFieldValue_' + lotTypeFieldId] as + | string + | undefined - await (lotFieldValue && lotFieldValue !== '' - ? addOrUpdateLotField( - { - lotId: lotForm.lotId, - lotTypeFieldId, - lotFieldValue - }, + await ((lotFieldValue ?? '') === '' + ? deleteLotField( + lotForm.lotId, + lotTypeFieldId, requestSession, database ) - : deleteLotField( - lotForm.lotId, - lotTypeFieldId, + : addOrUpdateLotField( + { + lotId: lotForm.lotId, + lotTypeFieldId, + lotFieldValue: lotFieldValue! + }, requestSession, database )) diff --git a/helpers/lotOccupancyDB/updateLotOccupancy.js b/helpers/lotOccupancyDB/updateLotOccupancy.js index b3091ba2..eeab4e3a 100644 --- a/helpers/lotOccupancyDB/updateLotOccupancy.js +++ b/helpers/lotOccupancyDB/updateLotOccupancy.js @@ -22,13 +22,13 @@ export async function updateLotOccupancy(lotOccupancyForm, requestSession) { const occupancyTypeFieldIds = (lotOccupancyForm.occupancyTypeFieldIds ?? '').split(','); for (const occupancyTypeFieldId of occupancyTypeFieldIds) { const lotOccupancyFieldValue = lotOccupancyForm['lotOccupancyFieldValue_' + occupancyTypeFieldId]; - await (lotOccupancyFieldValue && lotOccupancyFieldValue !== '' - ? addOrUpdateLotOccupancyField({ + await ((lotOccupancyFieldValue ?? '') === '' + ? deleteLotOccupancyField(lotOccupancyForm.lotOccupancyId, occupancyTypeFieldId, requestSession, database) + : addOrUpdateLotOccupancyField({ lotOccupancyId: lotOccupancyForm.lotOccupancyId, occupancyTypeFieldId, lotOccupancyFieldValue - }, requestSession, database) - : deleteLotOccupancyField(lotOccupancyForm.lotOccupancyId, occupancyTypeFieldId, requestSession, database)); + }, requestSession, database)); } } database.release(); diff --git a/helpers/lotOccupancyDB/updateLotOccupancy.ts b/helpers/lotOccupancyDB/updateLotOccupancy.ts index 8b78f1c2..310cd1d6 100644 --- a/helpers/lotOccupancyDB/updateLotOccupancy.ts +++ b/helpers/lotOccupancyDB/updateLotOccupancy.ts @@ -64,8 +64,14 @@ export async function updateLotOccupancy( 'lotOccupancyFieldValue_' + occupancyTypeFieldId ] as string - await (lotOccupancyFieldValue && lotOccupancyFieldValue !== '' - ? addOrUpdateLotOccupancyField( + await ((lotOccupancyFieldValue ?? '') === '' + ? deleteLotOccupancyField( + lotOccupancyForm.lotOccupancyId, + occupancyTypeFieldId, + requestSession, + database + ) + : addOrUpdateLotOccupancyField( { lotOccupancyId: lotOccupancyForm.lotOccupancyId, occupancyTypeFieldId, @@ -73,12 +79,6 @@ export async function updateLotOccupancy( }, requestSession, database - ) - : deleteLotOccupancyField( - lotOccupancyForm.lotOccupancyId, - occupancyTypeFieldId, - requestSession, - database )) } } diff --git a/helpers/lotOccupancyDB/updateRecord.ts b/helpers/lotOccupancyDB/updateRecord.ts index d92d7967..7fed98a3 100644 --- a/helpers/lotOccupancyDB/updateRecord.ts +++ b/helpers/lotOccupancyDB/updateRecord.ts @@ -12,7 +12,7 @@ type RecordTable = | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes' -const recordNameIdColumns: Map = new Map() +const recordNameIdColumns = new Map() recordNameIdColumns.set('FeeCategories', ['feeCategory', 'feeCategoryId']) recordNameIdColumns.set('LotStatuses', ['lotStatus', 'lotStatusId']) recordNameIdColumns.set('LotTypes', ['lotType', 'lotTypeId']) diff --git a/helpers/lotOccupancyDB/updateRecordOrderNumber.ts b/helpers/lotOccupancyDB/updateRecordOrderNumber.ts index e802c9db..316cfa55 100644 --- a/helpers/lotOccupancyDB/updateRecordOrderNumber.ts +++ b/helpers/lotOccupancyDB/updateRecordOrderNumber.ts @@ -12,7 +12,7 @@ type RecordTable = | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes' -const recordIdColumns: Map = new Map() +const recordIdColumns = new Map() recordIdColumns.set('FeeCategories', 'feeCategoryId') recordIdColumns.set('Fees', 'feeId') recordIdColumns.set('LotOccupantTypes', 'lotOccupantTypeId')