diff --git a/handlers/admin-post/doAddFeeCategory.d.ts b/handlers/admin-post/doAddFeeCategory.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddFeeCategory.d.ts +++ b/handlers/admin-post/doAddFeeCategory.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddFeeCategory.js b/handlers/admin-post/doAddFeeCategory.js index dabd63e4..e1b78403 100644 --- a/handlers/admin-post/doAddFeeCategory.js +++ b/handlers/admin-post/doAddFeeCategory.js @@ -1,7 +1,7 @@ -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getFeeCategories } from "../../helpers/lotOccupancyDB/getFeeCategories.js"; -export const handler = async (request, response) => { - const feeCategoryId = addRecord("FeeCategories", request.body.feeCategory, request.body.orderNumber || -1, request.session); +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +export const handler = (request, response) => { + const feeCategoryId = addRecord('FeeCategories', request.body.feeCategory, request.body.orderNumber ?? -1, request.session); const feeCategories = getFeeCategories({}, { includeFees: true }); diff --git a/handlers/admin-post/doAddFeeCategory.ts b/handlers/admin-post/doAddFeeCategory.ts index ef9c748a..45233ccc 100644 --- a/handlers/admin-post/doAddFeeCategory.ts +++ b/handlers/admin-post/doAddFeeCategory.ts @@ -1,29 +1,29 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' -import { getFeeCategories } from "../../helpers/lotOccupancyDB/getFeeCategories.js"; +import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' -export const handler: RequestHandler = async (request, response) => { - const feeCategoryId = addRecord( - "FeeCategories", - request.body.feeCategory, - request.body.orderNumber || -1, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const feeCategoryId = addRecord( + 'FeeCategories', + request.body.feeCategory, + request.body.orderNumber ?? -1, + request.session + ) - const feeCategories = getFeeCategories( - {}, - { - includeFees: true - } - ); + const feeCategories = getFeeCategories( + {}, + { + includeFees: true + } + ) - response.json({ - success: true, - feeCategoryId, - feeCategories - }); -}; + response.json({ + success: true, + feeCategoryId, + feeCategories + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddLotOccupantType.d.ts b/handlers/admin-post/doAddLotOccupantType.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddLotOccupantType.d.ts +++ b/handlers/admin-post/doAddLotOccupantType.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddLotOccupantType.js b/handlers/admin-post/doAddLotOccupantType.js index b1513222..6fc45422 100644 --- a/handlers/admin-post/doAddLotOccupantType.js +++ b/handlers/admin-post/doAddLotOccupantType.js @@ -1,6 +1,6 @@ -import { addLotOccupantType } from "../../helpers/lotOccupancyDB/addLotOccupantType.js"; -import { getLotOccupantTypes } from "../../helpers/functions.cache.js"; -export const handler = async (request, response) => { +import { addLotOccupantType } from '../../helpers/lotOccupancyDB/addLotOccupantType.js'; +import { getLotOccupantTypes } from '../../helpers/functions.cache.js'; +export const handler = (request, response) => { const lotOccupantTypeId = addLotOccupantType(request.body, request.session); const lotOccupantTypes = getLotOccupantTypes(); response.json({ diff --git a/handlers/admin-post/doAddLotOccupantType.ts b/handlers/admin-post/doAddLotOccupantType.ts index cc6c3ddd..918e429f 100644 --- a/handlers/admin-post/doAddLotOccupantType.ts +++ b/handlers/admin-post/doAddLotOccupantType.ts @@ -1,19 +1,19 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLotOccupantType } from "../../helpers/lotOccupancyDB/addLotOccupantType.js"; +import { addLotOccupantType } from '../../helpers/lotOccupancyDB/addLotOccupantType.js' -import { getLotOccupantTypes } from "../../helpers/functions.cache.js"; +import { getLotOccupantTypes } from '../../helpers/functions.cache.js' -export const handler: RequestHandler = async (request, response) => { - const lotOccupantTypeId = addLotOccupantType(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const lotOccupantTypeId = addLotOccupantType(request.body, request.session) - const lotOccupantTypes = getLotOccupantTypes(); + const lotOccupantTypes = getLotOccupantTypes() - response.json({ - success: true, - lotOccupantTypeId, - lotOccupantTypes - }); -}; + response.json({ + success: true, + lotOccupantTypeId, + lotOccupantTypes + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddLotStatus.d.ts b/handlers/admin-post/doAddLotStatus.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddLotStatus.d.ts +++ b/handlers/admin-post/doAddLotStatus.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddLotStatus.js b/handlers/admin-post/doAddLotStatus.js index c573c802..509b0a8f 100644 --- a/handlers/admin-post/doAddLotStatus.js +++ b/handlers/admin-post/doAddLotStatus.js @@ -1,7 +1,7 @@ -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getLotStatuses } from "../../helpers/functions.cache.js"; -export const handler = async (request, response) => { - const lotStatusId = addRecord("LotStatuses", request.body.lotStatus, request.body.orderNumber || -1, request.session); +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { getLotStatuses } from '../../helpers/functions.cache.js'; +export const handler = (request, response) => { + const lotStatusId = addRecord('LotStatuses', request.body.lotStatus, request.body.orderNumber ?? -1, request.session); const lotStatuses = getLotStatuses(); response.json({ success: true, diff --git a/handlers/admin-post/doAddLotStatus.ts b/handlers/admin-post/doAddLotStatus.ts index 94e11645..97456a8f 100644 --- a/handlers/admin-post/doAddLotStatus.ts +++ b/handlers/admin-post/doAddLotStatus.ts @@ -1,23 +1,23 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getLotStatuses } from "../../helpers/functions.cache.js"; +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { getLotStatuses } from '../../helpers/functions.cache.js' -export const handler: RequestHandler = async (request, response) => { - const lotStatusId = addRecord( - "LotStatuses", - request.body.lotStatus, - request.body.orderNumber || -1, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const lotStatusId = addRecord( + 'LotStatuses', + request.body.lotStatus, + request.body.orderNumber ?? -1, + request.session + ) - const lotStatuses = getLotStatuses(); + const lotStatuses = getLotStatuses() - response.json({ - success: true, - lotStatusId, - lotStatuses - }); -}; + response.json({ + success: true, + lotStatusId, + lotStatuses + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddLotType.d.ts b/handlers/admin-post/doAddLotType.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddLotType.d.ts +++ b/handlers/admin-post/doAddLotType.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddLotType.js b/handlers/admin-post/doAddLotType.js index ee9d343b..e0c9f9b8 100644 --- a/handlers/admin-post/doAddLotType.js +++ b/handlers/admin-post/doAddLotType.js @@ -1,7 +1,7 @@ -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getLotTypes } from "../../helpers/functions.cache.js"; -export const handler = async (request, response) => { - const lotTypeId = addRecord("LotTypes", request.body.lotType, request.body.orderNumber || -1, request.session); +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { getLotTypes } from '../../helpers/functions.cache.js'; +export const handler = (request, response) => { + const lotTypeId = addRecord('LotTypes', request.body.lotType, request.body.orderNumber ?? -1, request.session); const lotTypes = getLotTypes(); response.json({ success: true, diff --git a/handlers/admin-post/doAddLotType.ts b/handlers/admin-post/doAddLotType.ts index 0787dae4..24f82a21 100644 --- a/handlers/admin-post/doAddLotType.ts +++ b/handlers/admin-post/doAddLotType.ts @@ -1,23 +1,23 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getLotTypes } from "../../helpers/functions.cache.js"; +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { getLotTypes } from '../../helpers/functions.cache.js' -export const handler: RequestHandler = async (request, response) => { - const lotTypeId = addRecord( - "LotTypes", - request.body.lotType, - request.body.orderNumber || -1, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const lotTypeId = addRecord( + 'LotTypes', + request.body.lotType, + request.body.orderNumber ?? -1, + request.session + ) - const lotTypes = getLotTypes(); + const lotTypes = getLotTypes() - response.json({ - success: true, - lotTypeId, - lotTypes - }); -}; + response.json({ + success: true, + lotTypeId, + lotTypes + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddLotTypeField.d.ts b/handlers/admin-post/doAddLotTypeField.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddLotTypeField.d.ts +++ b/handlers/admin-post/doAddLotTypeField.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddLotTypeField.js b/handlers/admin-post/doAddLotTypeField.js index 4696384c..1f2c8ae9 100644 --- a/handlers/admin-post/doAddLotTypeField.js +++ b/handlers/admin-post/doAddLotTypeField.js @@ -1,6 +1,6 @@ -import { addLotTypeField } from "../../helpers/lotOccupancyDB/addLotTypeField.js"; -import { getLotTypes } from "../../helpers/functions.cache.js"; -export const handler = async (request, response) => { +import { addLotTypeField } from '../../helpers/lotOccupancyDB/addLotTypeField.js'; +import { getLotTypes } from '../../helpers/functions.cache.js'; +export const handler = (request, response) => { const lotTypeFieldId = addLotTypeField(request.body, request.session); const lotTypes = getLotTypes(); response.json({ diff --git a/handlers/admin-post/doAddLotTypeField.ts b/handlers/admin-post/doAddLotTypeField.ts index 987d1599..b65f7b07 100644 --- a/handlers/admin-post/doAddLotTypeField.ts +++ b/handlers/admin-post/doAddLotTypeField.ts @@ -1,19 +1,19 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLotTypeField } from "../../helpers/lotOccupancyDB/addLotTypeField.js"; +import { addLotTypeField } from '../../helpers/lotOccupancyDB/addLotTypeField.js' -import { getLotTypes } from "../../helpers/functions.cache.js"; +import { getLotTypes } from '../../helpers/functions.cache.js' -export const handler: RequestHandler = async (request, response) => { - const lotTypeFieldId = addLotTypeField(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const lotTypeFieldId = addLotTypeField(request.body, request.session) - const lotTypes = getLotTypes(); + const lotTypes = getLotTypes() - response.json({ - success: true, - lotTypeFieldId, - lotTypes - }); -}; + response.json({ + success: true, + lotTypeFieldId, + lotTypes + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddOccupancyType.d.ts b/handlers/admin-post/doAddOccupancyType.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddOccupancyType.d.ts +++ b/handlers/admin-post/doAddOccupancyType.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddOccupancyType.js b/handlers/admin-post/doAddOccupancyType.js index f9e5e3ff..c0df1646 100644 --- a/handlers/admin-post/doAddOccupancyType.js +++ b/handlers/admin-post/doAddOccupancyType.js @@ -1,7 +1,7 @@ -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getAllOccupancyTypeFields, getOccupancyTypes } from "../../helpers/functions.cache.js"; -export const handler = async (request, response) => { - const occupancyTypeId = addRecord("OccupancyTypes", request.body.occupancyType, request.body.orderNumber || -1, request.session); +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; +export const handler = (request, response) => { + const occupancyTypeId = addRecord('OccupancyTypes', request.body.occupancyType, request.body.orderNumber ?? -1, request.session); const occupancyTypes = getOccupancyTypes(); const allOccupancyTypeFields = getAllOccupancyTypeFields(); response.json({ diff --git a/handlers/admin-post/doAddOccupancyType.ts b/handlers/admin-post/doAddOccupancyType.ts index acdb7660..79c14a73 100644 --- a/handlers/admin-post/doAddOccupancyType.ts +++ b/handlers/admin-post/doAddOccupancyType.ts @@ -1,25 +1,28 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getAllOccupancyTypeFields, getOccupancyTypes } from "../../helpers/functions.cache.js"; +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { + getAllOccupancyTypeFields, + getOccupancyTypes +} from '../../helpers/functions.cache.js' -export const handler: RequestHandler = async (request, response) => { - const occupancyTypeId = addRecord( - "OccupancyTypes", - request.body.occupancyType, - request.body.orderNumber || -1, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const occupancyTypeId = addRecord( + 'OccupancyTypes', + request.body.occupancyType, + request.body.orderNumber ?? -1, + request.session + ) - const occupancyTypes = getOccupancyTypes(); - const allOccupancyTypeFields = getAllOccupancyTypeFields(); + const occupancyTypes = getOccupancyTypes() + const allOccupancyTypeFields = getAllOccupancyTypeFields() - response.json({ - success: true, - occupancyTypeId, - occupancyTypes, - allOccupancyTypeFields - }); -}; + response.json({ + success: true, + occupancyTypeId, + occupancyTypes, + allOccupancyTypeFields + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddOccupancyTypeField.d.ts b/handlers/admin-post/doAddOccupancyTypeField.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddOccupancyTypeField.d.ts +++ b/handlers/admin-post/doAddOccupancyTypeField.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddOccupancyTypeField.js b/handlers/admin-post/doAddOccupancyTypeField.js index 81f7bba5..3e3482e7 100644 --- a/handlers/admin-post/doAddOccupancyTypeField.js +++ b/handlers/admin-post/doAddOccupancyTypeField.js @@ -1,6 +1,6 @@ -import { addOccupancyTypeField } from "../../helpers/lotOccupancyDB/addOccupancyTypeField.js"; -import { getAllOccupancyTypeFields, getOccupancyTypes } from "../../helpers/functions.cache.js"; -export const handler = async (request, response) => { +import { addOccupancyTypeField } from '../../helpers/lotOccupancyDB/addOccupancyTypeField.js'; +import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; +export const handler = (request, response) => { const occupancyTypeFieldId = addOccupancyTypeField(request.body, request.session); const occupancyTypes = getOccupancyTypes(); const allOccupancyTypeFields = getAllOccupancyTypeFields(); diff --git a/handlers/admin-post/doAddOccupancyTypeField.ts b/handlers/admin-post/doAddOccupancyTypeField.ts index 8d1ee285..81fb11fa 100644 --- a/handlers/admin-post/doAddOccupancyTypeField.ts +++ b/handlers/admin-post/doAddOccupancyTypeField.ts @@ -1,21 +1,27 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addOccupancyTypeField } from "../../helpers/lotOccupancyDB/addOccupancyTypeField.js"; +import { addOccupancyTypeField } from '../../helpers/lotOccupancyDB/addOccupancyTypeField.js' -import { getAllOccupancyTypeFields, getOccupancyTypes } from "../../helpers/functions.cache.js"; +import { + getAllOccupancyTypeFields, + getOccupancyTypes +} from '../../helpers/functions.cache.js' -export const handler: RequestHandler = async (request, response) => { - const occupancyTypeFieldId = addOccupancyTypeField(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const occupancyTypeFieldId = addOccupancyTypeField( + request.body, + request.session + ) - const occupancyTypes = getOccupancyTypes(); - const allOccupancyTypeFields = getAllOccupancyTypeFields(); + const occupancyTypes = getOccupancyTypes() + const allOccupancyTypeFields = getAllOccupancyTypeFields() - response.json({ - success: true, - occupancyTypeFieldId, - occupancyTypes, - allOccupancyTypeFields - }); -}; + response.json({ + success: true, + occupancyTypeFieldId, + occupancyTypes, + allOccupancyTypeFields + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddOccupancyTypePrint.d.ts b/handlers/admin-post/doAddOccupancyTypePrint.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddOccupancyTypePrint.d.ts +++ b/handlers/admin-post/doAddOccupancyTypePrint.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddOccupancyTypePrint.js b/handlers/admin-post/doAddOccupancyTypePrint.js index 250319e7..d98e8593 100644 --- a/handlers/admin-post/doAddOccupancyTypePrint.js +++ b/handlers/admin-post/doAddOccupancyTypePrint.js @@ -1,6 +1,6 @@ -import { addOccupancyTypePrint } from "../../helpers/lotOccupancyDB/addOccupancyTypePrint.js"; -import { getAllOccupancyTypeFields, getOccupancyTypes } from "../../helpers/functions.cache.js"; -export const handler = async (request, response) => { +import { addOccupancyTypePrint } from '../../helpers/lotOccupancyDB/addOccupancyTypePrint.js'; +import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; +export const handler = (request, response) => { const success = addOccupancyTypePrint(request.body, request.session); const occupancyTypes = getOccupancyTypes(); const allOccupancyTypeFields = getAllOccupancyTypeFields(); diff --git a/handlers/admin-post/doAddOccupancyTypePrint.ts b/handlers/admin-post/doAddOccupancyTypePrint.ts index 868738fb..fb8fa72b 100644 --- a/handlers/admin-post/doAddOccupancyTypePrint.ts +++ b/handlers/admin-post/doAddOccupancyTypePrint.ts @@ -1,20 +1,23 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addOccupancyTypePrint } from "../../helpers/lotOccupancyDB/addOccupancyTypePrint.js"; +import { addOccupancyTypePrint } from '../../helpers/lotOccupancyDB/addOccupancyTypePrint.js' -import { getAllOccupancyTypeFields, getOccupancyTypes } from "../../helpers/functions.cache.js"; +import { + getAllOccupancyTypeFields, + getOccupancyTypes +} from '../../helpers/functions.cache.js' -export const handler: RequestHandler = async (request, response) => { - const success = addOccupancyTypePrint(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const success = addOccupancyTypePrint(request.body, request.session) - const occupancyTypes = getOccupancyTypes(); - const allOccupancyTypeFields = getAllOccupancyTypeFields(); + const occupancyTypes = getOccupancyTypes() + const allOccupancyTypeFields = getAllOccupancyTypeFields() - response.json({ - success, - occupancyTypes, - allOccupancyTypeFields - }); -}; + response.json({ + success, + occupancyTypes, + allOccupancyTypeFields + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddWorkOrderMilestoneType.d.ts b/handlers/admin-post/doAddWorkOrderMilestoneType.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddWorkOrderMilestoneType.d.ts +++ b/handlers/admin-post/doAddWorkOrderMilestoneType.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddWorkOrderMilestoneType.js b/handlers/admin-post/doAddWorkOrderMilestoneType.js index 32e7beb0..81f6d3ca 100644 --- a/handlers/admin-post/doAddWorkOrderMilestoneType.js +++ b/handlers/admin-post/doAddWorkOrderMilestoneType.js @@ -1,7 +1,7 @@ -import { getWorkOrderMilestoneTypes } from "../../helpers/functions.cache.js"; -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -export const handler = async (request, response) => { - const workOrderMilestoneTypeId = addRecord("WorkOrderMilestoneTypes", request.body.workOrderMilestoneType, request.body.orderNumber || -1, request.session); +import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'; +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +export const handler = (request, response) => { + const workOrderMilestoneTypeId = addRecord('WorkOrderMilestoneTypes', request.body.workOrderMilestoneType, request.body.orderNumber ?? -1, request.session); const workOrderMilestoneTypes = getWorkOrderMilestoneTypes(); response.json({ success: true, diff --git a/handlers/admin-post/doAddWorkOrderMilestoneType.ts b/handlers/admin-post/doAddWorkOrderMilestoneType.ts index 775aaa8a..e08f5487 100644 --- a/handlers/admin-post/doAddWorkOrderMilestoneType.ts +++ b/handlers/admin-post/doAddWorkOrderMilestoneType.ts @@ -1,23 +1,23 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { getWorkOrderMilestoneTypes } from "../../helpers/functions.cache.js"; -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; +import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js' +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' -export const handler: RequestHandler = async (request, response) => { - const workOrderMilestoneTypeId = addRecord( - "WorkOrderMilestoneTypes", - request.body.workOrderMilestoneType, - request.body.orderNumber || -1, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const workOrderMilestoneTypeId = addRecord( + 'WorkOrderMilestoneTypes', + request.body.workOrderMilestoneType, + request.body.orderNumber ?? -1, + request.session + ) - const workOrderMilestoneTypes = getWorkOrderMilestoneTypes(); + const workOrderMilestoneTypes = getWorkOrderMilestoneTypes() - response.json({ - success: true, - workOrderMilestoneTypeId, - workOrderMilestoneTypes - }); -}; + response.json({ + success: true, + workOrderMilestoneTypeId, + workOrderMilestoneTypes + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doAddWorkOrderType.d.ts b/handlers/admin-post/doAddWorkOrderType.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doAddWorkOrderType.d.ts +++ b/handlers/admin-post/doAddWorkOrderType.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doAddWorkOrderType.js b/handlers/admin-post/doAddWorkOrderType.js index 865addb1..f3b5edc3 100644 --- a/handlers/admin-post/doAddWorkOrderType.js +++ b/handlers/admin-post/doAddWorkOrderType.js @@ -1,7 +1,7 @@ -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getWorkOrderTypes } from "../../helpers/functions.cache.js"; -export const handler = async (request, response) => { - const workOrderTypeId = addRecord("WorkOrderTypes", request.body.workOrderType, request.body.orderNumber || -1, request.session); +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { getWorkOrderTypes } from '../../helpers/functions.cache.js'; +export const handler = (request, response) => { + const workOrderTypeId = addRecord('WorkOrderTypes', request.body.workOrderType, request.body.orderNumber ?? -1, request.session); const workOrderTypes = getWorkOrderTypes(); response.json({ success: true, diff --git a/handlers/admin-post/doAddWorkOrderType.ts b/handlers/admin-post/doAddWorkOrderType.ts index fa10e98e..843bcae4 100644 --- a/handlers/admin-post/doAddWorkOrderType.ts +++ b/handlers/admin-post/doAddWorkOrderType.ts @@ -1,23 +1,23 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addRecord } from "../../helpers/lotOccupancyDB/addRecord.js"; -import { getWorkOrderTypes } from "../../helpers/functions.cache.js"; +import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { getWorkOrderTypes } from '../../helpers/functions.cache.js' -export const handler: RequestHandler = async (request, response) => { - const workOrderTypeId = addRecord( - "WorkOrderTypes", - request.body.workOrderType, - request.body.orderNumber || -1, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const workOrderTypeId = addRecord( + 'WorkOrderTypes', + request.body.workOrderType, + request.body.orderNumber ?? -1, + request.session + ) - const workOrderTypes = getWorkOrderTypes(); + const workOrderTypes = getWorkOrderTypes() - response.json({ - success: true, - workOrderTypeId, - workOrderTypes - }); -}; + response.json({ + success: true, + workOrderTypeId, + workOrderTypes + }) +} -export default handler; +export default handler diff --git a/handlers/admin-post/doCleanupDatabase.d.ts b/handlers/admin-post/doCleanupDatabase.d.ts index 9621c611..7151ed90 100644 --- a/handlers/admin-post/doCleanupDatabase.d.ts +++ b/handlers/admin-post/doCleanupDatabase.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/admin-post/doCleanupDatabase.js b/handlers/admin-post/doCleanupDatabase.js index 06590ea4..aa31cd54 100644 --- a/handlers/admin-post/doCleanupDatabase.js +++ b/handlers/admin-post/doCleanupDatabase.js @@ -1,5 +1,5 @@ -import { cleanupDatabase } from "../../helpers/lotOccupancyDB/cleanupDatabase.js"; -export const handler = async (request, response) => { +import { cleanupDatabase } from '../../helpers/lotOccupancyDB/cleanupDatabase.js'; +export const handler = (request, response) => { const recordCounts = cleanupDatabase(request.session); response.json({ success: true, diff --git a/handlers/admin-post/doCleanupDatabase.ts b/handlers/admin-post/doCleanupDatabase.ts index c0519a00..298d3351 100644 --- a/handlers/admin-post/doCleanupDatabase.ts +++ b/handlers/admin-post/doCleanupDatabase.ts @@ -1,15 +1,15 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { cleanupDatabase } from "../../helpers/lotOccupancyDB/cleanupDatabase.js"; +import { cleanupDatabase } from '../../helpers/lotOccupancyDB/cleanupDatabase.js' -export const handler: RequestHandler = async (request, response) => { - const recordCounts = cleanupDatabase(request.session); +export const handler: RequestHandler = (request, response) => { + const recordCounts = cleanupDatabase(request.session) - response.json({ - success: true, - inactivedRecordCount: recordCounts.inactivedRecordCount, - purgedRecordCount: recordCounts.purgedRecordCount - }); -}; + response.json({ + success: true, + inactivedRecordCount: recordCounts.inactivedRecordCount, + purgedRecordCount: recordCounts.purgedRecordCount + }) +} -export default handler; +export default handler diff --git a/handlers/dashboard-get/dashboard.d.ts b/handlers/dashboard-get/dashboard.d.ts index 9621c611..7151ed90 100644 --- a/handlers/dashboard-get/dashboard.d.ts +++ b/handlers/dashboard-get/dashboard.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/dashboard-get/dashboard.js b/handlers/dashboard-get/dashboard.js index 491635a5..51ab8c68 100644 --- a/handlers/dashboard-get/dashboard.js +++ b/handlers/dashboard-get/dashboard.js @@ -1,13 +1,13 @@ -import { dateToString } from "@cityssm/expressjs-server-js/dateTimeFns.js"; -import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js"; -import { getWorkOrders } from "../../helpers/lotOccupancyDB/getWorkOrders.js"; +import { dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js'; +import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; +import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js'; export const handler = (_request, response) => { const currentDateString = dateToString(new Date()); const workOrderMilestones = getWorkOrderMilestones({ - workOrderMilestoneDateFilter: "date", + workOrderMilestoneDateFilter: 'date', workOrderMilestoneDateString: currentDateString }, { - orderBy: "completion", + orderBy: 'completion', includeWorkOrders: true }); const workOrderCount = getWorkOrders({ @@ -16,8 +16,8 @@ export const handler = (_request, response) => { limit: 1, offset: 0 }).count; - response.render("dashboard", { - headTitle: "Dashboard", + response.render('dashboard', { + headTitle: 'Dashboard', workOrderMilestones, workOrderCount }); diff --git a/handlers/dashboard-get/dashboard.ts b/handlers/dashboard-get/dashboard.ts index 3e1e48d7..f0d0ae1b 100644 --- a/handlers/dashboard-get/dashboard.ts +++ b/handlers/dashboard-get/dashboard.ts @@ -1,39 +1,39 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { dateToString } from "@cityssm/expressjs-server-js/dateTimeFns.js"; +import { dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js' -import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js"; -import { getWorkOrders } from "../../helpers/lotOccupancyDB/getWorkOrders.js"; +import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' +import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js' export const handler: RequestHandler = (_request, response) => { - const currentDateString = dateToString(new Date()); + const currentDateString = dateToString(new Date()) - const workOrderMilestones = getWorkOrderMilestones( - { - workOrderMilestoneDateFilter: "date", - workOrderMilestoneDateString: currentDateString - }, - { - orderBy: "completion", - includeWorkOrders: true - } - ); + const workOrderMilestones = getWorkOrderMilestones( + { + workOrderMilestoneDateFilter: 'date', + workOrderMilestoneDateString: currentDateString + }, + { + orderBy: 'completion', + includeWorkOrders: true + } + ) - const workOrderCount = getWorkOrders( - { - workOrderOpenDateString: currentDateString - }, - { - limit: 1, - offset: 0 - } - ).count; + const workOrderCount = getWorkOrders( + { + workOrderOpenDateString: currentDateString + }, + { + limit: 1, + offset: 0 + } + ).count - response.render("dashboard", { - headTitle: "Dashboard", - workOrderMilestones, - workOrderCount - }); -}; + response.render('dashboard', { + headTitle: 'Dashboard', + workOrderMilestones, + workOrderCount + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-get/search.d.ts b/handlers/lotOccupancies-get/search.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-get/search.d.ts +++ b/handlers/lotOccupancies-get/search.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-get/search.js b/handlers/lotOccupancies-get/search.js index 11e933e2..0396d7e9 100644 --- a/handlers/lotOccupancies-get/search.js +++ b/handlers/lotOccupancies-get/search.js @@ -1,12 +1,12 @@ -import * as configFunctions from "../../helpers/functions.config.js"; -import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js"; -import { getLotTypes, getOccupancyTypes } from "../../helpers/functions.cache.js"; +import * as configFunctions from '../../helpers/functions.config.js'; +import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; +import { getLotTypes, getOccupancyTypes } from '../../helpers/functions.cache.js'; export const handler = (request, response) => { const maps = getMaps(); const lotTypes = getLotTypes(); const occupancyTypes = getOccupancyTypes(); - response.render("lotOccupancy-search", { - headTitle: configFunctions.getProperty("aliases.occupancy") + " Search", + response.render('lotOccupancy-search', { + headTitle: configFunctions.getProperty('aliases.occupancy') + ' Search', maps, lotTypes, occupancyTypes, diff --git a/handlers/lotOccupancies-get/search.ts b/handlers/lotOccupancies-get/search.ts index 5ed59fc5..09d96157 100644 --- a/handlers/lotOccupancies-get/search.ts +++ b/handlers/lotOccupancies-get/search.ts @@ -1,23 +1,26 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import * as configFunctions from "../../helpers/functions.config.js"; +import * as configFunctions from '../../helpers/functions.config.js' -import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js"; +import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' -import { getLotTypes, getOccupancyTypes } from "../../helpers/functions.cache.js"; +import { + getLotTypes, + getOccupancyTypes +} from '../../helpers/functions.cache.js' export const handler: RequestHandler = (request, response) => { - const maps = getMaps(); - const lotTypes = getLotTypes(); - const occupancyTypes = getOccupancyTypes(); + const maps = getMaps() + const lotTypes = getLotTypes() + const occupancyTypes = getOccupancyTypes() - response.render("lotOccupancy-search", { - headTitle: configFunctions.getProperty("aliases.occupancy") + " Search", - maps, - lotTypes, - occupancyTypes, - mapId: request.query.mapId - }); -}; + response.render('lotOccupancy-search', { + headTitle: configFunctions.getProperty('aliases.occupancy') + ' Search', + maps, + lotTypes, + occupancyTypes, + mapId: request.query.mapId + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyComment.d.ts b/handlers/lotOccupancies-post/doAddLotOccupancyComment.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyComment.d.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyComment.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyComment.js b/handlers/lotOccupancies-post/doAddLotOccupancyComment.js index cd5cbc73..a433a8f9 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyComment.js +++ b/handlers/lotOccupancies-post/doAddLotOccupancyComment.js @@ -1,6 +1,6 @@ -import { addLotOccupancyComment } from "../../helpers/lotOccupancyDB/addLotOccupancyComment.js"; -import { getLotOccupancyComments } from "../../helpers/lotOccupancyDB/getLotOccupancyComments.js"; -export const handler = async (request, response) => { +import { addLotOccupancyComment } from '../../helpers/lotOccupancyDB/addLotOccupancyComment.js'; +import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js'; +export const handler = (request, response) => { addLotOccupancyComment(request.body, request.session); const lotOccupancyComments = getLotOccupancyComments(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyComment.ts b/handlers/lotOccupancies-post/doAddLotOccupancyComment.ts index 51a5063b..975c7359 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyComment.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyComment.ts @@ -1,20 +1,20 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLotOccupancyComment } from "../../helpers/lotOccupancyDB/addLotOccupancyComment.js"; +import { addLotOccupancyComment } from '../../helpers/lotOccupancyDB/addLotOccupancyComment.js' -import { getLotOccupancyComments } from "../../helpers/lotOccupancyDB/getLotOccupancyComments.js"; +import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js' -export const handler: RequestHandler = async (request, response) => { - addLotOccupancyComment(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + addLotOccupancyComment(request.body, request.session) - const lotOccupancyComments = getLotOccupancyComments( - request.body.lotOccupancyId - ); + const lotOccupancyComments = getLotOccupancyComments( + request.body.lotOccupancyId + ) - response.json({ - success: true, - lotOccupancyComments - }); -}; + response.json({ + success: true, + lotOccupancyComments + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyFee.d.ts b/handlers/lotOccupancies-post/doAddLotOccupancyFee.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyFee.d.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyFee.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyFee.js b/handlers/lotOccupancies-post/doAddLotOccupancyFee.js index 33e164ae..8ef933ed 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyFee.js +++ b/handlers/lotOccupancies-post/doAddLotOccupancyFee.js @@ -1,6 +1,6 @@ -import { addLotOccupancyFee } from "../../helpers/lotOccupancyDB/addLotOccupancyFee.js"; -import { getLotOccupancyFees } from "../../helpers/lotOccupancyDB/getLotOccupancyFees.js"; -export const handler = async (request, response) => { +import { addLotOccupancyFee } from '../../helpers/lotOccupancyDB/addLotOccupancyFee.js'; +import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js'; +export const handler = (request, response) => { addLotOccupancyFee(request.body, request.session); const lotOccupancyFees = getLotOccupancyFees(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyFee.ts b/handlers/lotOccupancies-post/doAddLotOccupancyFee.ts index de0d152b..ab14e5e5 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyFee.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyFee.ts @@ -1,18 +1,18 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLotOccupancyFee } from "../../helpers/lotOccupancyDB/addLotOccupancyFee.js"; +import { addLotOccupancyFee } from '../../helpers/lotOccupancyDB/addLotOccupancyFee.js' -import { getLotOccupancyFees } from "../../helpers/lotOccupancyDB/getLotOccupancyFees.js"; +import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js' -export const handler: RequestHandler = async (request, response) => { - addLotOccupancyFee(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + addLotOccupancyFee(request.body, request.session) - const lotOccupancyFees = getLotOccupancyFees(request.body.lotOccupancyId); + const lotOccupancyFees = getLotOccupancyFees(request.body.lotOccupancyId) - response.json({ - success: true, - lotOccupancyFees - }); -}; + response.json({ + success: true, + lotOccupancyFees + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.d.ts b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.d.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.js b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.js index b298c4ac..2ad9da77 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.js +++ b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.js @@ -1,6 +1,6 @@ -import { addLotOccupancyOccupant } from "../../helpers/lotOccupancyDB/addLotOccupancyOccupant.js"; -import { getLotOccupancyOccupants } from "../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js"; -export const handler = async (request, response) => { +import { addLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/addLotOccupancyOccupant.js'; +import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js'; +export const handler = (request, response) => { addLotOccupancyOccupant(request.body, request.session); const lotOccupancyOccupants = getLotOccupancyOccupants(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.ts b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.ts index de98ddd8..06d32145 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.ts @@ -1,20 +1,20 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLotOccupancyOccupant } from "../../helpers/lotOccupancyDB/addLotOccupancyOccupant.js"; +import { addLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/addLotOccupancyOccupant.js' -import { getLotOccupancyOccupants } from "../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js"; +import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js' -export const handler: RequestHandler = async (request, response) => { - addLotOccupancyOccupant(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + addLotOccupancyOccupant(request.body, request.session) - const lotOccupancyOccupants = getLotOccupancyOccupants( - request.body.lotOccupancyId - ); + const lotOccupancyOccupants = getLotOccupancyOccupants( + request.body.lotOccupancyId + ) - response.json({ - success: true, - lotOccupancyOccupants - }); -}; + response.json({ + success: true, + lotOccupancyOccupants + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.d.ts b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.d.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.js b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.js index 8960245c..a09fbf21 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.js +++ b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.js @@ -1,6 +1,6 @@ -import { addLotOccupancyTransaction } from "../../helpers/lotOccupancyDB/addLotOccupancyTransaction.js"; -import { getLotOccupancyTransactions } from "../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js"; -export const handler = async (request, response) => { +import { addLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/addLotOccupancyTransaction.js'; +import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js'; +export const handler = (request, response) => { addLotOccupancyTransaction(request.body, request.session); const lotOccupancyTransactions = getLotOccupancyTransactions(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.ts b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.ts index d8e009c1..eb38c1e1 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.ts @@ -1,20 +1,20 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLotOccupancyTransaction } from "../../helpers/lotOccupancyDB/addLotOccupancyTransaction.js"; +import { addLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/addLotOccupancyTransaction.js' -import { getLotOccupancyTransactions } from "../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js"; +import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js' -export const handler: RequestHandler = async (request, response) => { - addLotOccupancyTransaction(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + addLotOccupancyTransaction(request.body, request.session) - const lotOccupancyTransactions = getLotOccupancyTransactions( - request.body.lotOccupancyId - ); + const lotOccupancyTransactions = getLotOccupancyTransactions( + request.body.lotOccupancyId + ) - response.json({ - success: true, - lotOccupancyTransactions - }); -}; + response.json({ + success: true, + lotOccupancyTransactions + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doCopyLotOccupancy.d.ts b/handlers/lotOccupancies-post/doCopyLotOccupancy.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doCopyLotOccupancy.d.ts +++ b/handlers/lotOccupancies-post/doCopyLotOccupancy.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doCopyLotOccupancy.js b/handlers/lotOccupancies-post/doCopyLotOccupancy.js index 1e8bb02d..3da363ab 100644 --- a/handlers/lotOccupancies-post/doCopyLotOccupancy.js +++ b/handlers/lotOccupancies-post/doCopyLotOccupancy.js @@ -1,5 +1,5 @@ -import { copyLotOccupancy } from "../../helpers/lotOccupancyDB/copyLotOccupancy.js"; -export const handler = async (request, response) => { +import { copyLotOccupancy } from '../../helpers/lotOccupancyDB/copyLotOccupancy.js'; +export const handler = (request, response) => { const lotOccupancyId = copyLotOccupancy(request.body.lotOccupancyId, request.session); response.json({ success: true, diff --git a/handlers/lotOccupancies-post/doCopyLotOccupancy.ts b/handlers/lotOccupancies-post/doCopyLotOccupancy.ts index 35eadacb..11605508 100644 --- a/handlers/lotOccupancies-post/doCopyLotOccupancy.ts +++ b/handlers/lotOccupancies-post/doCopyLotOccupancy.ts @@ -1,14 +1,17 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { copyLotOccupancy } from "../../helpers/lotOccupancyDB/copyLotOccupancy.js"; +import { copyLotOccupancy } from '../../helpers/lotOccupancyDB/copyLotOccupancy.js' -export const handler: RequestHandler = async (request, response) => { - const lotOccupancyId = copyLotOccupancy(request.body.lotOccupancyId, request.session); +export const handler: RequestHandler = (request, response) => { + const lotOccupancyId = copyLotOccupancy( + request.body.lotOccupancyId, + request.session + ) - response.json({ - success: true, - lotOccupancyId - }); -}; + response.json({ + success: true, + lotOccupancyId + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doCreateLotOccupancy.d.ts b/handlers/lotOccupancies-post/doCreateLotOccupancy.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doCreateLotOccupancy.d.ts +++ b/handlers/lotOccupancies-post/doCreateLotOccupancy.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doCreateLotOccupancy.js b/handlers/lotOccupancies-post/doCreateLotOccupancy.js index 51d25141..377b2c30 100644 --- a/handlers/lotOccupancies-post/doCreateLotOccupancy.js +++ b/handlers/lotOccupancies-post/doCreateLotOccupancy.js @@ -1,5 +1,5 @@ -import { addLotOccupancy } from "../../helpers/lotOccupancyDB/addLotOccupancy.js"; -export const handler = async (request, response) => { +import { addLotOccupancy } from '../../helpers/lotOccupancyDB/addLotOccupancy.js'; +export const handler = (request, response) => { const lotOccupancyId = addLotOccupancy(request.body, request.session); response.json({ success: true, diff --git a/handlers/lotOccupancies-post/doCreateLotOccupancy.ts b/handlers/lotOccupancies-post/doCreateLotOccupancy.ts index c3cdeb6b..2eb7724d 100644 --- a/handlers/lotOccupancies-post/doCreateLotOccupancy.ts +++ b/handlers/lotOccupancies-post/doCreateLotOccupancy.ts @@ -1,14 +1,14 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLotOccupancy } from "../../helpers/lotOccupancyDB/addLotOccupancy.js"; +import { addLotOccupancy } from '../../helpers/lotOccupancyDB/addLotOccupancy.js' -export const handler: RequestHandler = async (request, response) => { - const lotOccupancyId = addLotOccupancy(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const lotOccupancyId = addLotOccupancy(request.body, request.session) - response.json({ - success: true, - lotOccupancyId - }); -}; + response.json({ + success: true, + lotOccupancyId + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancy.d.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancy.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancy.d.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancy.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancy.js b/handlers/lotOccupancies-post/doDeleteLotOccupancy.js index 3f145f28..9afafbfe 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancy.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancy.js @@ -1,6 +1,6 @@ -import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js"; -export const handler = async (request, response) => { - const success = deleteRecord("LotOccupancies", request.body.lotOccupancyId, request.session); +import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +export const handler = (request, response) => { + const success = deleteRecord('LotOccupancies', request.body.lotOccupancyId, request.session); response.json({ success }); diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancy.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancy.ts index 1dc1a92f..adbd9414 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancy.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancy.ts @@ -1,13 +1,17 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js"; +import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -export const handler: RequestHandler = async (request, response) => { - const success = deleteRecord("LotOccupancies", request.body.lotOccupancyId, request.session); +export const handler: RequestHandler = (request, response) => { + const success = deleteRecord( + 'LotOccupancies', + request.body.lotOccupancyId, + request.session + ) - response.json({ - success - }); -}; + response.json({ + success + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.d.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.d.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.js b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.js index ad9a4a0f..e72c0004 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.js @@ -1,7 +1,7 @@ -import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js"; -import { getLotOccupancyComments } from "../../helpers/lotOccupancyDB/getLotOccupancyComments.js"; -export const handler = async (request, response) => { - const success = deleteRecord("LotOccupancyComments", request.body.lotOccupancyCommentId, request.session); +import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js'; +export const handler = (request, response) => { + const success = deleteRecord('LotOccupancyComments', request.body.lotOccupancyCommentId, request.session); const lotOccupancyComments = getLotOccupancyComments(request.body.lotOccupancyId); response.json({ success, diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.ts index 2516cf4d..83620543 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.ts @@ -1,18 +1,24 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js"; +import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -import { getLotOccupancyComments } from "../../helpers/lotOccupancyDB/getLotOccupancyComments.js"; +import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js' -export const handler: RequestHandler = async (request, response) => { - const success = deleteRecord("LotOccupancyComments", request.body.lotOccupancyCommentId, request.session); +export const handler: RequestHandler = (request, response) => { + const success = deleteRecord( + 'LotOccupancyComments', + request.body.lotOccupancyCommentId, + request.session + ) - const lotOccupancyComments = getLotOccupancyComments(request.body.lotOccupancyId); + const lotOccupancyComments = getLotOccupancyComments( + request.body.lotOccupancyId + ) - response.json({ - success, - lotOccupancyComments - }); -}; + response.json({ + success, + lotOccupancyComments + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.d.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.d.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.js b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.js index 0fc5c8c5..3b56e3b9 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.js @@ -1,6 +1,6 @@ -import { deleteLotOccupancyFee } from "../../helpers/lotOccupancyDB/deleteLotOccupancyFee.js"; -import { getLotOccupancyFees } from "../../helpers/lotOccupancyDB/getLotOccupancyFees.js"; -export const handler = async (request, response) => { +import { deleteLotOccupancyFee } from '../../helpers/lotOccupancyDB/deleteLotOccupancyFee.js'; +import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js'; +export const handler = (request, response) => { const success = deleteLotOccupancyFee(request.body.lotOccupancyId, request.body.feeId, request.session); const lotOccupancyFees = getLotOccupancyFees(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.ts index 26e36106..27f619a4 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.ts @@ -1,22 +1,22 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { deleteLotOccupancyFee } from "../../helpers/lotOccupancyDB/deleteLotOccupancyFee.js"; +import { deleteLotOccupancyFee } from '../../helpers/lotOccupancyDB/deleteLotOccupancyFee.js' -import { getLotOccupancyFees } from "../../helpers/lotOccupancyDB/getLotOccupancyFees.js"; +import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js' -export const handler: RequestHandler = async (request, response) => { - const success = deleteLotOccupancyFee( - request.body.lotOccupancyId, - request.body.feeId, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const success = deleteLotOccupancyFee( + request.body.lotOccupancyId, + request.body.feeId, + request.session + ) - const lotOccupancyFees = getLotOccupancyFees(request.body.lotOccupancyId); + const lotOccupancyFees = getLotOccupancyFees(request.body.lotOccupancyId) - response.json({ - success, - lotOccupancyFees - }); -}; + response.json({ + success, + lotOccupancyFees + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.d.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.d.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.js b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.js index d9c4cc6c..003aa855 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.js @@ -1,6 +1,6 @@ -import { deleteLotOccupancyOccupant } from "../../helpers/lotOccupancyDB/deleteLotOccupancyOccupant.js"; -import { getLotOccupancyOccupants } from "../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js"; -export const handler = async (request, response) => { +import { deleteLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/deleteLotOccupancyOccupant.js'; +import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js'; +export const handler = (request, response) => { const success = deleteLotOccupancyOccupant(request.body.lotOccupancyId, request.body.lotOccupantIndex, request.session); const lotOccupancyOccupants = getLotOccupancyOccupants(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.ts index 0c6bbeb4..fbc03a7e 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.ts @@ -1,24 +1,24 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { deleteLotOccupancyOccupant } from "../../helpers/lotOccupancyDB/deleteLotOccupancyOccupant.js"; +import { deleteLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/deleteLotOccupancyOccupant.js' -import { getLotOccupancyOccupants } from "../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js"; +import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js' -export const handler: RequestHandler = async (request, response) => { - const success = deleteLotOccupancyOccupant( - request.body.lotOccupancyId, - request.body.lotOccupantIndex, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const success = deleteLotOccupancyOccupant( + request.body.lotOccupancyId, + request.body.lotOccupantIndex, + request.session + ) - const lotOccupancyOccupants = getLotOccupancyOccupants( - request.body.lotOccupancyId - ); + const lotOccupancyOccupants = getLotOccupancyOccupants( + request.body.lotOccupancyId + ) - response.json({ - success, - lotOccupancyOccupants - }); -}; + response.json({ + success, + lotOccupancyOccupants + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.d.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.d.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.js b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.js index 2c974b43..05b57f78 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.js @@ -1,6 +1,6 @@ -import { deleteLotOccupancyTransaction } from "../../helpers/lotOccupancyDB/deleteLotOccupancyTransaction.js"; -import { getLotOccupancyTransactions } from "../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js"; -export const handler = async (request, response) => { +import { deleteLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/deleteLotOccupancyTransaction.js'; +import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js'; +export const handler = (request, response) => { const success = deleteLotOccupancyTransaction(request.body.lotOccupancyId, request.body.transactionIndex, request.session); const lotOccupancyTransactions = getLotOccupancyTransactions(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.ts index 2175d096..c8bb6b94 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.ts @@ -1,24 +1,24 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { deleteLotOccupancyTransaction } from "../../helpers/lotOccupancyDB/deleteLotOccupancyTransaction.js"; +import { deleteLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/deleteLotOccupancyTransaction.js' -import { getLotOccupancyTransactions } from "../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js"; +import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js' -export const handler: RequestHandler = async (request, response) => { - const success = deleteLotOccupancyTransaction( - request.body.lotOccupancyId, - request.body.transactionIndex, - request.session - ); +export const handler: RequestHandler = (request, response) => { + const success = deleteLotOccupancyTransaction( + request.body.lotOccupancyId, + request.body.transactionIndex, + request.session + ) - const lotOccupancyTransactions = getLotOccupancyTransactions( - request.body.lotOccupancyId - ); + const lotOccupancyTransactions = getLotOccupancyTransactions( + request.body.lotOccupancyId + ) - response.json({ - success, - lotOccupancyTransactions - }); -}; + response.json({ + success, + lotOccupancyTransactions + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doSearchLotOccupancies.d.ts b/handlers/lotOccupancies-post/doSearchLotOccupancies.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doSearchLotOccupancies.d.ts +++ b/handlers/lotOccupancies-post/doSearchLotOccupancies.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doSearchLotOccupancies.js b/handlers/lotOccupancies-post/doSearchLotOccupancies.js index d7db2a47..351b429c 100644 --- a/handlers/lotOccupancies-post/doSearchLotOccupancies.js +++ b/handlers/lotOccupancies-post/doSearchLotOccupancies.js @@ -1,5 +1,5 @@ -import { getLotOccupancies } from "../../helpers/lotOccupancyDB/getLotOccupancies.js"; -export const handler = async (request, response) => { +import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js'; +export const handler = (request, response) => { const result = getLotOccupancies(request.body, { limit: request.body.limit, offset: request.body.offset, diff --git a/handlers/lotOccupancies-post/doSearchLotOccupancies.ts b/handlers/lotOccupancies-post/doSearchLotOccupancies.ts index a80f1579..dacecd60 100644 --- a/handlers/lotOccupancies-post/doSearchLotOccupancies.ts +++ b/handlers/lotOccupancies-post/doSearchLotOccupancies.ts @@ -1,19 +1,19 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { getLotOccupancies } from "../../helpers/lotOccupancyDB/getLotOccupancies.js"; +import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js' -export const handler: RequestHandler = async (request, response) => { - const result = getLotOccupancies(request.body, { - limit: request.body.limit, - offset: request.body.offset, - includeOccupants: true - }); +export const handler: RequestHandler = (request, response) => { + const result = getLotOccupancies(request.body, { + limit: request.body.limit, + offset: request.body.offset, + includeOccupants: true + }) - response.json({ - count: result.count, - offset: Number.parseInt(request.body.offset, 10), - lotOccupancies: result.lotOccupancies - }); -}; + response.json({ + count: result.count, + offset: Number.parseInt(request.body.offset, 10), + lotOccupancies: result.lotOccupancies + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doSearchPastOccupants.d.ts b/handlers/lotOccupancies-post/doSearchPastOccupants.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doSearchPastOccupants.d.ts +++ b/handlers/lotOccupancies-post/doSearchPastOccupants.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doSearchPastOccupants.js b/handlers/lotOccupancies-post/doSearchPastOccupants.js index 682596e9..5b14bd05 100644 --- a/handlers/lotOccupancies-post/doSearchPastOccupants.js +++ b/handlers/lotOccupancies-post/doSearchPastOccupants.js @@ -1,4 +1,4 @@ -import { getPastLotOccupancyOccupants } from "../../helpers/lotOccupancyDB/getPastLotOccupancyOccupants.js"; +import { getPastLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getPastLotOccupancyOccupants.js'; export const handler = (request, response) => { const occupants = getPastLotOccupancyOccupants(request.body, { limit: Number.parseInt(request.body.limit, 10) diff --git a/handlers/lotOccupancies-post/doSearchPastOccupants.ts b/handlers/lotOccupancies-post/doSearchPastOccupants.ts index ea58123e..93e81197 100644 --- a/handlers/lotOccupancies-post/doSearchPastOccupants.ts +++ b/handlers/lotOccupancies-post/doSearchPastOccupants.ts @@ -1,16 +1,15 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { getPastLotOccupancyOccupants } from "../../helpers/lotOccupancyDB/getPastLotOccupancyOccupants.js"; +import { getPastLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getPastLotOccupancyOccupants.js' export const handler: RequestHandler = (request, response) => { + const occupants = getPastLotOccupancyOccupants(request.body, { + limit: Number.parseInt(request.body.limit, 10) + }) - const occupants = getPastLotOccupancyOccupants(request.body, { - limit: Number.parseInt(request.body.limit, 10) - }); + response.json({ + occupants + }) +} - response.json({ - occupants - }); -}; - -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancy.d.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancy.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancy.d.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancy.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancy.js b/handlers/lotOccupancies-post/doUpdateLotOccupancy.js index a3fb0f10..cd5b7adc 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancy.js +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancy.js @@ -1,5 +1,5 @@ -import { updateLotOccupancy } from "../../helpers/lotOccupancyDB/updateLotOccupancy.js"; -export const handler = async (request, response) => { +import { updateLotOccupancy } from '../../helpers/lotOccupancyDB/updateLotOccupancy.js'; +export const handler = (request, response) => { const success = updateLotOccupancy(request.body, request.session); response.json({ success, diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancy.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancy.ts index 5cffc759..f57a3476 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancy.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancy.ts @@ -1,14 +1,14 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { updateLotOccupancy } from "../../helpers/lotOccupancyDB/updateLotOccupancy.js"; +import { updateLotOccupancy } from '../../helpers/lotOccupancyDB/updateLotOccupancy.js' -export const handler: RequestHandler = async (request, response) => { - const success = updateLotOccupancy(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const success = updateLotOccupancy(request.body, request.session) - response.json({ - success, - lotOccupancyId: request.body.lotOccupancyId - }); -}; + response.json({ + success, + lotOccupancyId: request.body.lotOccupancyId + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.d.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.d.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.js b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.js index 0d19ad56..68f8c056 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.js +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.js @@ -1,6 +1,6 @@ -import { updateLotOccupancyComment } from "../../helpers/lotOccupancyDB/updateLotOccupancyComment.js"; -import { getLotOccupancyComments } from "../../helpers/lotOccupancyDB/getLotOccupancyComments.js"; -export const handler = async (request, response) => { +import { updateLotOccupancyComment } from '../../helpers/lotOccupancyDB/updateLotOccupancyComment.js'; +import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js'; +export const handler = (request, response) => { const success = updateLotOccupancyComment(request.body, request.session); const lotOccupancyComments = getLotOccupancyComments(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.ts index 04d6713f..58b61d6e 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.ts @@ -1,20 +1,20 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { updateLotOccupancyComment } from "../../helpers/lotOccupancyDB/updateLotOccupancyComment.js"; +import { updateLotOccupancyComment } from '../../helpers/lotOccupancyDB/updateLotOccupancyComment.js' -import { getLotOccupancyComments } from "../../helpers/lotOccupancyDB/getLotOccupancyComments.js"; +import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js' -export const handler: RequestHandler = async (request, response) => { - const success = updateLotOccupancyComment(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const success = updateLotOccupancyComment(request.body, request.session) - const lotOccupancyComments = getLotOccupancyComments( - request.body.lotOccupancyId - ); + const lotOccupancyComments = getLotOccupancyComments( + request.body.lotOccupancyId + ) - response.json({ - success, - lotOccupancyComments - }); -}; + response.json({ + success, + lotOccupancyComments + }) +} -export default handler; +export default handler diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.d.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.d.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.js b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.js index 0d0ab199..e9de44a1 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.js +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.js @@ -1,6 +1,6 @@ -import { updateLotOccupancyOccupant } from "../../helpers/lotOccupancyDB/updateLotOccupancyOccupant.js"; -import { getLotOccupancyOccupants } from "../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js"; -export const handler = async (request, response) => { +import { updateLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/updateLotOccupancyOccupant.js'; +import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js'; +export const handler = (request, response) => { const success = updateLotOccupancyOccupant(request.body, request.session); const lotOccupancyOccupants = getLotOccupancyOccupants(request.body.lotOccupancyId); response.json({ diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.ts index 69455117..d2e5974c 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.ts @@ -1,20 +1,20 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { updateLotOccupancyOccupant } from "../../helpers/lotOccupancyDB/updateLotOccupancyOccupant.js"; +import { updateLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/updateLotOccupancyOccupant.js' -import { getLotOccupancyOccupants } from "../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js"; +import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js' -export const handler: RequestHandler = async (request, response) => { - const success = updateLotOccupancyOccupant(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const success = updateLotOccupancyOccupant(request.body, request.session) - const lotOccupancyOccupants = getLotOccupancyOccupants( - request.body.lotOccupancyId - ); + const lotOccupancyOccupants = getLotOccupancyOccupants( + request.body.lotOccupancyId + ) - response.json({ - success, - lotOccupancyOccupants - }); -}; + response.json({ + success, + lotOccupancyOccupants + }) +} -export default handler; +export default handler diff --git a/handlers/lots-get/edit.d.ts b/handlers/lots-get/edit.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-get/edit.d.ts +++ b/handlers/lots-get/edit.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-get/edit.js b/handlers/lots-get/edit.js index 3e783da0..468f5f9f 100644 --- a/handlers/lots-get/edit.js +++ b/handlers/lots-get/edit.js @@ -1,16 +1,18 @@ -import * as configFunctions from "../../helpers/functions.config.js"; -import { getLot } from "../../helpers/lotOccupancyDB/getLot.js"; -import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js"; -import * as cacheFunctions from "../../helpers/functions.cache.js"; +import * as configFunctions from '../../helpers/functions.config.js'; +import { getLot } from '../../helpers/lotOccupancyDB/getLot.js'; +import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; +import * as cacheFunctions from '../../helpers/functions.cache.js'; export const handler = (request, response) => { const lot = getLot(request.params.lotId); if (!lot) { - return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/?error=lotIdNotFound"); + response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/?error=lotIdNotFound'); + return; } const maps = getMaps(); const lotTypes = cacheFunctions.getLotTypes(); const lotStatuses = cacheFunctions.getLotStatuses(); - return response.render("lot-edit", { + response.render('lot-edit', { headTitle: lot.lotName, lot, isCreate: false, diff --git a/handlers/lots-get/edit.ts b/handlers/lots-get/edit.ts index 9f8db751..abf08f49 100644 --- a/handlers/lots-get/edit.ts +++ b/handlers/lots-get/edit.ts @@ -1,32 +1,34 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import * as configFunctions from "../../helpers/functions.config.js"; +import * as configFunctions from '../../helpers/functions.config.js' -import { getLot } from "../../helpers/lotOccupancyDB/getLot.js"; -import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js"; -import * as cacheFunctions from "../../helpers/functions.cache.js"; +import { getLot } from '../../helpers/lotOccupancyDB/getLot.js' +import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' +import * as cacheFunctions from '../../helpers/functions.cache.js' export const handler: RequestHandler = (request, response) => { - const lot = getLot(request.params.lotId); + const lot = getLot(request.params.lotId) - if (!lot) { - return response.redirect( - configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/?error=lotIdNotFound" - ); - } + if (!lot) { + response.redirect( + configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/?error=lotIdNotFound' + ) + return + } - const maps = getMaps(); - const lotTypes = cacheFunctions.getLotTypes(); - const lotStatuses = cacheFunctions.getLotStatuses(); + const maps = getMaps() + const lotTypes = cacheFunctions.getLotTypes() + const lotStatuses = cacheFunctions.getLotStatuses() - return response.render("lot-edit", { - headTitle: lot.lotName, - lot, - isCreate: false, - maps, - lotTypes, - lotStatuses - }); -}; + response.render('lot-edit', { + headTitle: lot.lotName, + lot, + isCreate: false, + maps, + lotTypes, + lotStatuses + }) +} -export default handler; +export default handler diff --git a/handlers/lots-get/new.d.ts b/handlers/lots-get/new.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-get/new.d.ts +++ b/handlers/lots-get/new.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-get/new.js b/handlers/lots-get/new.js index 1c2c1234..206b0bdd 100644 --- a/handlers/lots-get/new.js +++ b/handlers/lots-get/new.js @@ -1,6 +1,6 @@ -import * as configFunctions from "../../helpers/functions.config.js"; -import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js"; -import * as cacheFunctions from "../../helpers/functions.cache.js"; +import * as configFunctions from '../../helpers/functions.config.js'; +import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; +import * as cacheFunctions from '../../helpers/functions.cache.js'; export const handler = (request, response) => { const lot = { lotId: -1, @@ -19,8 +19,8 @@ export const handler = (request, response) => { } const lotTypes = cacheFunctions.getLotTypes(); const lotStatuses = cacheFunctions.getLotStatuses(); - response.render("lot-edit", { - headTitle: "Create a New " + configFunctions.getProperty("aliases.lot"), + response.render('lot-edit', { + headTitle: 'Create a New ' + configFunctions.getProperty('aliases.lot'), lot, isCreate: true, maps, diff --git a/handlers/lots-get/new.ts b/handlers/lots-get/new.ts index 03a0d909..61683f19 100644 --- a/handlers/lots-get/new.ts +++ b/handlers/lots-get/new.ts @@ -1,44 +1,44 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import * as configFunctions from "../../helpers/functions.config.js"; +import * as configFunctions from '../../helpers/functions.config.js' -import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js"; -import * as cacheFunctions from "../../helpers/functions.cache.js"; +import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' +import * as cacheFunctions from '../../helpers/functions.cache.js' -import * as recordTypes from "../../types/recordTypes"; +import * as recordTypes from '../../types/recordTypes' export const handler: RequestHandler = (request, response) => { - const lot: recordTypes.Lot = { - lotId: -1, - lotOccupancies: [] - }; + const lot: recordTypes.Lot = { + lotId: -1, + lotOccupancies: [] + } - const maps = getMaps(); + const maps = getMaps() - if (request.query.mapId) { - const mapId = Number.parseInt(request.query.mapId as string, 10); + if (request.query.mapId) { + const mapId = Number.parseInt(request.query.mapId as string, 10) - const map = maps.find((possibleMap) => { - return mapId === possibleMap.mapId; - }); + const map = maps.find((possibleMap) => { + return mapId === possibleMap.mapId + }) - if (map) { - lot.mapId = map.mapId; - lot.mapName = map.mapName; - } + if (map) { + lot.mapId = map.mapId + lot.mapName = map.mapName } + } - const lotTypes = cacheFunctions.getLotTypes(); - const lotStatuses = cacheFunctions.getLotStatuses(); + const lotTypes = cacheFunctions.getLotTypes() + const lotStatuses = cacheFunctions.getLotStatuses() - response.render("lot-edit", { - headTitle: "Create a New " + configFunctions.getProperty("aliases.lot"), - lot, - isCreate: true, - maps, - lotTypes, - lotStatuses - }); -}; + response.render('lot-edit', { + headTitle: 'Create a New ' + configFunctions.getProperty('aliases.lot'), + lot, + isCreate: true, + maps, + lotTypes, + lotStatuses + }) +} -export default handler; +export default handler diff --git a/handlers/lots-get/next.d.ts b/handlers/lots-get/next.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-get/next.d.ts +++ b/handlers/lots-get/next.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-get/next.js b/handlers/lots-get/next.js index a90e2d1e..f7e315be 100644 --- a/handlers/lots-get/next.js +++ b/handlers/lots-get/next.js @@ -1,11 +1,13 @@ -import * as configFunctions from "../../helpers/functions.config.js"; -import { getNextLotId } from "../../helpers/lotOccupancyDB/getNextLotId.js"; +import * as configFunctions from '../../helpers/functions.config.js'; +import { getNextLotId } from '../../helpers/lotOccupancyDB/getNextLotId.js'; export const handler = (request, response) => { const lotId = request.params.lotId; const nextLotId = getNextLotId(lotId); if (!nextLotId) { - return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/?error=noNextLotIdFound"); + response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/?error=noNextLotIdFound'); + return; } - return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/" + nextLotId); + response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + '/lots/' + nextLotId); }; export default handler; diff --git a/handlers/lots-get/next.ts b/handlers/lots-get/next.ts index 60bdd38e..b08b42e7 100644 --- a/handlers/lots-get/next.ts +++ b/handlers/lots-get/next.ts @@ -1,23 +1,25 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import * as configFunctions from "../../helpers/functions.config.js"; +import * as configFunctions from '../../helpers/functions.config.js' -import { getNextLotId } from "../../helpers/lotOccupancyDB/getNextLotId.js"; +import { getNextLotId } from '../../helpers/lotOccupancyDB/getNextLotId.js' export const handler: RequestHandler = (request, response) => { - const lotId = request.params.lotId; + const lotId = request.params.lotId - const nextLotId = getNextLotId(lotId); + const nextLotId = getNextLotId(lotId) - if (!nextLotId) { - return response.redirect( - configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/?error=noNextLotIdFound" - ); - } + if (!nextLotId) { + response.redirect( + configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/?error=noNextLotIdFound' + ) + return + } - return response.redirect( - configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/" + nextLotId - ); -}; + response.redirect( + configFunctions.getProperty('reverseProxy.urlPrefix') + '/lots/' + nextLotId + ) +} -export default handler; +export default handler diff --git a/handlers/lots-get/previous.d.ts b/handlers/lots-get/previous.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-get/previous.d.ts +++ b/handlers/lots-get/previous.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-get/previous.js b/handlers/lots-get/previous.js index 2f28e5ea..78871319 100644 --- a/handlers/lots-get/previous.js +++ b/handlers/lots-get/previous.js @@ -1,12 +1,15 @@ -import * as configFunctions from "../../helpers/functions.config.js"; -import { getPreviousLotId } from "../../helpers/lotOccupancyDB/getPreviousLotId.js"; +import * as configFunctions from '../../helpers/functions.config.js'; +import { getPreviousLotId } from '../../helpers/lotOccupancyDB/getPreviousLotId.js'; export const handler = (request, response) => { const lotId = request.params.lotId; const previousLotId = getPreviousLotId(lotId); if (!previousLotId) { - return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") + - "/lots/?error=noPreviousLotIdFound"); + response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/?error=noPreviousLotIdFound'); + return; } - return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/" + previousLotId); + response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/' + + previousLotId); }; export default handler; diff --git a/handlers/lots-get/previous.ts b/handlers/lots-get/previous.ts index 34e68b9f..3b028827 100644 --- a/handlers/lots-get/previous.ts +++ b/handlers/lots-get/previous.ts @@ -1,24 +1,27 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import * as configFunctions from "../../helpers/functions.config.js"; +import * as configFunctions from '../../helpers/functions.config.js' -import { getPreviousLotId } from "../../helpers/lotOccupancyDB/getPreviousLotId.js"; +import { getPreviousLotId } from '../../helpers/lotOccupancyDB/getPreviousLotId.js' export const handler: RequestHandler = (request, response) => { - const lotId = request.params.lotId; + const lotId = request.params.lotId - const previousLotId = getPreviousLotId(lotId); + const previousLotId = getPreviousLotId(lotId) - if (!previousLotId) { - return response.redirect( - configFunctions.getProperty("reverseProxy.urlPrefix") + - "/lots/?error=noPreviousLotIdFound" - ); - } + if (!previousLotId) { + response.redirect( + configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/?error=noPreviousLotIdFound' + ) + return + } - return response.redirect( - configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/" + previousLotId - ); -}; + response.redirect( + configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/' + + previousLotId + ) +} -export default handler; +export default handler diff --git a/handlers/lots-get/search.d.ts b/handlers/lots-get/search.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-get/search.d.ts +++ b/handlers/lots-get/search.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-get/search.js b/handlers/lots-get/search.js index 5bc3ed8b..06d1c4c5 100644 --- a/handlers/lots-get/search.js +++ b/handlers/lots-get/search.js @@ -1,12 +1,12 @@ -import * as configFunctions from "../../helpers/functions.config.js"; -import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js"; -import { getLotTypes, getLotStatuses } from "../../helpers/functions.cache.js"; +import * as configFunctions from '../../helpers/functions.config.js'; +import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; +import { getLotTypes, getLotStatuses } from '../../helpers/functions.cache.js'; export const handler = (request, response) => { const maps = getMaps(); const lotTypes = getLotTypes(); const lotStatuses = getLotStatuses(); - response.render("lot-search", { - headTitle: configFunctions.getProperty("aliases.lot") + " Search", + response.render('lot-search', { + headTitle: configFunctions.getProperty('aliases.lot') + ' Search', maps, lotTypes, lotStatuses, diff --git a/handlers/lots-get/search.ts b/handlers/lots-get/search.ts index 6576ce76..0b68e53a 100644 --- a/handlers/lots-get/search.ts +++ b/handlers/lots-get/search.ts @@ -1,25 +1,25 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import * as configFunctions from "../../helpers/functions.config.js"; +import * as configFunctions from '../../helpers/functions.config.js' -import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js"; +import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' -import { getLotTypes, getLotStatuses } from "../../helpers/functions.cache.js"; +import { getLotTypes, getLotStatuses } from '../../helpers/functions.cache.js' export const handler: RequestHandler = (request, response) => { - const maps = getMaps(); - const lotTypes = getLotTypes(); - const lotStatuses = getLotStatuses(); + const maps = getMaps() + const lotTypes = getLotTypes() + const lotStatuses = getLotStatuses() - response.render("lot-search", { - headTitle: configFunctions.getProperty("aliases.lot") + " Search", - maps, - lotTypes, - lotStatuses, - mapId: request.query.mapId, - lotTypeId: request.query.lotTypeId, - lotStatusId: request.query.lotStatusId - }); -}; + response.render('lot-search', { + headTitle: configFunctions.getProperty('aliases.lot') + ' Search', + maps, + lotTypes, + lotStatuses, + mapId: request.query.mapId, + lotTypeId: request.query.lotTypeId, + lotStatusId: request.query.lotStatusId + }) +} -export default handler; +export default handler diff --git a/handlers/lots-get/view.d.ts b/handlers/lots-get/view.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-get/view.d.ts +++ b/handlers/lots-get/view.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-get/view.js b/handlers/lots-get/view.js index e83384e8..6e1a02fa 100644 --- a/handlers/lots-get/view.js +++ b/handlers/lots-get/view.js @@ -1,11 +1,13 @@ -import * as configFunctions from "../../helpers/functions.config.js"; -import { getLot } from "../../helpers/lotOccupancyDB/getLot.js"; +import * as configFunctions from '../../helpers/functions.config.js'; +import { getLot } from '../../helpers/lotOccupancyDB/getLot.js'; export const handler = (request, response) => { const lot = getLot(request.params.lotId); if (!lot) { - return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/?error=lotIdNotFound"); + response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/?error=lotIdNotFound'); + return; } - return response.render("lot-view", { + response.render('lot-view', { headTitle: lot.lotName, lot }); diff --git a/handlers/lots-get/view.ts b/handlers/lots-get/view.ts index fb1e97c8..810cce3e 100644 --- a/handlers/lots-get/view.ts +++ b/handlers/lots-get/view.ts @@ -1,22 +1,24 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import * as configFunctions from "../../helpers/functions.config.js"; +import * as configFunctions from '../../helpers/functions.config.js' -import { getLot } from "../../helpers/lotOccupancyDB/getLot.js"; +import { getLot } from '../../helpers/lotOccupancyDB/getLot.js' export const handler: RequestHandler = (request, response) => { - const lot = getLot(request.params.lotId); + const lot = getLot(request.params.lotId) - if (!lot) { - return response.redirect( - configFunctions.getProperty("reverseProxy.urlPrefix") + "/lots/?error=lotIdNotFound" - ); - } + if (!lot) { + response.redirect( + configFunctions.getProperty('reverseProxy.urlPrefix') + + '/lots/?error=lotIdNotFound' + ) + return + } - return response.render("lot-view", { - headTitle: lot.lotName, - lot - }); -}; + response.render('lot-view', { + headTitle: lot.lotName, + lot + }) +} -export default handler; +export default handler diff --git a/handlers/lots-post/doAddLotComment.d.ts b/handlers/lots-post/doAddLotComment.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-post/doAddLotComment.d.ts +++ b/handlers/lots-post/doAddLotComment.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-post/doAddLotComment.js b/handlers/lots-post/doAddLotComment.js index 2e3bd458..3b25ae8b 100644 --- a/handlers/lots-post/doAddLotComment.js +++ b/handlers/lots-post/doAddLotComment.js @@ -1,6 +1,6 @@ -import { addLotComment } from "../../helpers/lotOccupancyDB/addLotComment.js"; -import { getLotComments } from "../../helpers/lotOccupancyDB/getLotComments.js"; -export const handler = async (request, response) => { +import { addLotComment } from '../../helpers/lotOccupancyDB/addLotComment.js'; +import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js'; +export const handler = (request, response) => { addLotComment(request.body, request.session); const lotComments = getLotComments(request.body.lotId); response.json({ diff --git a/handlers/lots-post/doAddLotComment.ts b/handlers/lots-post/doAddLotComment.ts index 1359af1f..836cd0ee 100644 --- a/handlers/lots-post/doAddLotComment.ts +++ b/handlers/lots-post/doAddLotComment.ts @@ -1,18 +1,18 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLotComment } from "../../helpers/lotOccupancyDB/addLotComment.js"; +import { addLotComment } from '../../helpers/lotOccupancyDB/addLotComment.js' -import { getLotComments } from "../../helpers/lotOccupancyDB/getLotComments.js"; +import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js' -export const handler: RequestHandler = async (request, response) => { - addLotComment(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + addLotComment(request.body, request.session) - const lotComments = getLotComments(request.body.lotId); + const lotComments = getLotComments(request.body.lotId) - response.json({ - success: true, - lotComments - }); -}; + response.json({ + success: true, + lotComments + }) +} -export default handler; +export default handler diff --git a/handlers/lots-post/doCreateLot.d.ts b/handlers/lots-post/doCreateLot.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-post/doCreateLot.d.ts +++ b/handlers/lots-post/doCreateLot.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-post/doCreateLot.js b/handlers/lots-post/doCreateLot.js index 584fc0dd..f15b2099 100644 --- a/handlers/lots-post/doCreateLot.js +++ b/handlers/lots-post/doCreateLot.js @@ -1,5 +1,5 @@ -import { addLot } from "../../helpers/lotOccupancyDB/addLot.js"; -export const handler = async (request, response) => { +import { addLot } from '../../helpers/lotOccupancyDB/addLot.js'; +export const handler = (request, response) => { const lotId = addLot(request.body, request.session); response.json({ success: true, diff --git a/handlers/lots-post/doCreateLot.ts b/handlers/lots-post/doCreateLot.ts index 85c41bed..ac564e08 100644 --- a/handlers/lots-post/doCreateLot.ts +++ b/handlers/lots-post/doCreateLot.ts @@ -1,14 +1,14 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { addLot } from "../../helpers/lotOccupancyDB/addLot.js"; +import { addLot } from '../../helpers/lotOccupancyDB/addLot.js' -export const handler: RequestHandler = async (request, response) => { - const lotId = addLot(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const lotId = addLot(request.body, request.session) - response.json({ - success: true, - lotId - }); -}; + response.json({ + success: true, + lotId + }) +} -export default handler; +export default handler diff --git a/handlers/lots-post/doDeleteLot.d.ts b/handlers/lots-post/doDeleteLot.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-post/doDeleteLot.d.ts +++ b/handlers/lots-post/doDeleteLot.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-post/doDeleteLot.js b/handlers/lots-post/doDeleteLot.js index a4cd422e..678e8ee5 100644 --- a/handlers/lots-post/doDeleteLot.js +++ b/handlers/lots-post/doDeleteLot.js @@ -1,6 +1,6 @@ -import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js"; -export const handler = async (request, response) => { - const success = deleteRecord("Lots", request.body.lotId, request.session); +import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +export const handler = (request, response) => { + const success = deleteRecord('Lots', request.body.lotId, request.session); response.json({ success }); diff --git a/handlers/lots-post/doDeleteLot.ts b/handlers/lots-post/doDeleteLot.ts index 4243a71f..c9951011 100644 --- a/handlers/lots-post/doDeleteLot.ts +++ b/handlers/lots-post/doDeleteLot.ts @@ -1,13 +1,13 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js"; +import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -export const handler: RequestHandler = async (request, response) => { - const success = deleteRecord("Lots", request.body.lotId, request.session); +export const handler: RequestHandler = (request, response) => { + const success = deleteRecord('Lots', request.body.lotId, request.session) - response.json({ - success - }); -}; + response.json({ + success + }) +} -export default handler; +export default handler diff --git a/handlers/lots-post/doDeleteLotComment.d.ts b/handlers/lots-post/doDeleteLotComment.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-post/doDeleteLotComment.d.ts +++ b/handlers/lots-post/doDeleteLotComment.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-post/doDeleteLotComment.js b/handlers/lots-post/doDeleteLotComment.js index ecf4ff6c..393bccb1 100644 --- a/handlers/lots-post/doDeleteLotComment.js +++ b/handlers/lots-post/doDeleteLotComment.js @@ -1,7 +1,7 @@ -import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js"; -import { getLotComments } from "../../helpers/lotOccupancyDB/getLotComments.js"; -export const handler = async (request, response) => { - const success = deleteRecord("LotComments", request.body.lotCommentId, request.session); +import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js'; +export const handler = (request, response) => { + const success = deleteRecord('LotComments', request.body.lotCommentId, request.session); const lotComments = getLotComments(request.body.lotId); response.json({ success, diff --git a/handlers/lots-post/doDeleteLotComment.ts b/handlers/lots-post/doDeleteLotComment.ts index b42514cf..b877350f 100644 --- a/handlers/lots-post/doDeleteLotComment.ts +++ b/handlers/lots-post/doDeleteLotComment.ts @@ -1,18 +1,22 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js"; +import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -import { getLotComments } from "../../helpers/lotOccupancyDB/getLotComments.js"; +import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js' -export const handler: RequestHandler = async (request, response) => { - const success = deleteRecord("LotComments", request.body.lotCommentId, request.session); +export const handler: RequestHandler = (request, response) => { + const success = deleteRecord( + 'LotComments', + request.body.lotCommentId, + request.session + ) - const lotComments = getLotComments(request.body.lotId); + const lotComments = getLotComments(request.body.lotId) - response.json({ - success, - lotComments - }); -}; + response.json({ + success, + lotComments + }) +} -export default handler; +export default handler diff --git a/handlers/lots-post/doSearchLots.js b/handlers/lots-post/doSearchLots.js index bc629e84..3fa60057 100644 --- a/handlers/lots-post/doSearchLots.js +++ b/handlers/lots-post/doSearchLots.js @@ -1,5 +1,5 @@ import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'; -export const handler = async (request, response) => { +export const handler = (request, response) => { const result = getLots(request.body, { limit: request.body.limit, offset: request.body.offset diff --git a/handlers/lots-post/doSearchLots.ts b/handlers/lots-post/doSearchLots.ts index a56328c9..c804246e 100644 --- a/handlers/lots-post/doSearchLots.ts +++ b/handlers/lots-post/doSearchLots.ts @@ -1,18 +1,18 @@ -import type { RequestHandler } from 'express'; +import type { RequestHandler } from 'express' -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'; +import { getLots } from '../../helpers/lotOccupancyDB/getLots.js' -export const handler: RequestHandler = async (request, response) => { +export const handler: RequestHandler = (request, response) => { const result = getLots(request.body, { limit: request.body.limit, offset: request.body.offset - }); + }) response.json({ count: result.count, offset: Number.parseInt(request.body.offset, 10), lots: result.lots - }); -}; + }) +} -export default handler; +export default handler diff --git a/handlers/lots-post/doUpdateLot.d.ts b/handlers/lots-post/doUpdateLot.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-post/doUpdateLot.d.ts +++ b/handlers/lots-post/doUpdateLot.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-post/doUpdateLot.js b/handlers/lots-post/doUpdateLot.js index 1e5b4005..46244eec 100644 --- a/handlers/lots-post/doUpdateLot.js +++ b/handlers/lots-post/doUpdateLot.js @@ -1,5 +1,5 @@ -import { updateLot } from "../../helpers/lotOccupancyDB/updateLot.js"; -export const handler = async (request, response) => { +import { updateLot } from '../../helpers/lotOccupancyDB/updateLot.js'; +export const handler = (request, response) => { const success = updateLot(request.body, request.session); response.json({ success, diff --git a/handlers/lots-post/doUpdateLot.ts b/handlers/lots-post/doUpdateLot.ts index 74a55a03..4b3b5c83 100644 --- a/handlers/lots-post/doUpdateLot.ts +++ b/handlers/lots-post/doUpdateLot.ts @@ -1,14 +1,14 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { updateLot } from "../../helpers/lotOccupancyDB/updateLot.js"; +import { updateLot } from '../../helpers/lotOccupancyDB/updateLot.js' -export const handler: RequestHandler = async (request, response) => { - const success = updateLot(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const success = updateLot(request.body, request.session) - response.json({ - success, - lotId: request.body.lotId - }); -}; + response.json({ + success, + lotId: request.body.lotId + }) +} -export default handler; +export default handler diff --git a/handlers/lots-post/doUpdateLotComment.d.ts b/handlers/lots-post/doUpdateLotComment.d.ts index 9621c611..7151ed90 100644 --- a/handlers/lots-post/doUpdateLotComment.d.ts +++ b/handlers/lots-post/doUpdateLotComment.d.ts @@ -1,3 +1,3 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express'; export declare const handler: RequestHandler; export default handler; diff --git a/handlers/lots-post/doUpdateLotComment.js b/handlers/lots-post/doUpdateLotComment.js index 30ca5b6b..4748bb66 100644 --- a/handlers/lots-post/doUpdateLotComment.js +++ b/handlers/lots-post/doUpdateLotComment.js @@ -1,6 +1,6 @@ -import { updateLotComment } from "../../helpers/lotOccupancyDB/updateLotComment.js"; -import { getLotComments } from "../../helpers/lotOccupancyDB/getLotComments.js"; -export const handler = async (request, response) => { +import { updateLotComment } from '../../helpers/lotOccupancyDB/updateLotComment.js'; +import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js'; +export const handler = (request, response) => { const success = updateLotComment(request.body, request.session); const lotComments = getLotComments(request.body.lotId); response.json({ diff --git a/handlers/lots-post/doUpdateLotComment.ts b/handlers/lots-post/doUpdateLotComment.ts index 995ad9a0..58a01f72 100644 --- a/handlers/lots-post/doUpdateLotComment.ts +++ b/handlers/lots-post/doUpdateLotComment.ts @@ -1,18 +1,18 @@ -import type { RequestHandler } from "express"; +import type { RequestHandler } from 'express' -import { updateLotComment } from "../../helpers/lotOccupancyDB/updateLotComment.js"; +import { updateLotComment } from '../../helpers/lotOccupancyDB/updateLotComment.js' -import { getLotComments } from "../../helpers/lotOccupancyDB/getLotComments.js"; +import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js' -export const handler: RequestHandler = async (request, response) => { - const success = updateLotComment(request.body, request.session); +export const handler: RequestHandler = (request, response) => { + const success = updateLotComment(request.body, request.session) - const lotComments = getLotComments(request.body.lotId); + const lotComments = getLotComments(request.body.lotId) - response.json({ - success, - lotComments - }); -}; + response.json({ + success, + lotComments + }) +} -export default handler; +export default handler diff --git a/helpers/lotOccupancyDB/addRecord.d.ts b/helpers/lotOccupancyDB/addRecord.d.ts index cea01986..92ab2b5c 100644 --- a/helpers/lotOccupancyDB/addRecord.d.ts +++ b/helpers/lotOccupancyDB/addRecord.d.ts @@ -1,4 +1,4 @@ import type * as recordTypes from '../../types/recordTypes'; declare type RecordTable = 'FeeCategories' | 'LotStatuses' | 'LotTypes' | 'OccupancyTypes' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes'; -export declare function addRecord(recordTable: RecordTable, recordName: string, orderNumber: number, requestSession: recordTypes.PartialSession): number; +export declare function addRecord(recordTable: RecordTable, recordName: string, orderNumber: number | string, requestSession: recordTypes.PartialSession): number; export {}; diff --git a/helpers/lotOccupancyDB/addRecord.js b/helpers/lotOccupancyDB/addRecord.js index d3e8b7d6..a26e397b 100644 --- a/helpers/lotOccupancyDB/addRecord.js +++ b/helpers/lotOccupancyDB/addRecord.js @@ -17,7 +17,7 @@ export function addRecord(recordTable, recordName, orderNumber, requestSession) recordCreate_userName, recordCreate_timeMillis, recordUpdate_userName, recordUpdate_timeMillis) values (?, ?, ?, ?, ?, ?)`) - .run(recordName, orderNumber, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis); + .run(recordName, orderNumber === '' ? -1 : orderNumber, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis); database.close(); clearCacheByTableName(recordTable); return result.lastInsertRowid; diff --git a/helpers/lotOccupancyDB/addRecord.ts b/helpers/lotOccupancyDB/addRecord.ts index 330adfc2..06301cd6 100644 --- a/helpers/lotOccupancyDB/addRecord.ts +++ b/helpers/lotOccupancyDB/addRecord.ts @@ -24,7 +24,7 @@ recordNameColumns.set('WorkOrderTypes', 'workOrderType') export function addRecord( recordTable: RecordTable, recordName: string, - orderNumber: number, + orderNumber: number | string, requestSession: recordTypes.PartialSession ): number { const database = sqlite(databasePath) @@ -41,7 +41,7 @@ export function addRecord( ) .run( recordName, - orderNumber, + orderNumber === '' ? -1 : orderNumber, requestSession.user!.userName, rightNowMillis, requestSession.user!.userName,