From 4ab29dd5dfc4c2fee37df89fe21b11ed1f05ad4a Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Tue, 30 Aug 2022 14:47:31 -0400 Subject: [PATCH] linting --- handlers/maps-post/doCreateMap.ts | 18 ++++++---- handlers/maps-post/doUpdateMap.ts | 18 ++++++---- views/lot-edit.ejs | 58 +++++++++++++++---------------- views/lotOccupancy-edit.ejs | 2 +- views/lotOccupancy-view.ejs | 6 +++- 5 files changed, 57 insertions(+), 45 deletions(-) diff --git a/handlers/maps-post/doCreateMap.ts b/handlers/maps-post/doCreateMap.ts index 7388bde5..538f6031 100644 --- a/handlers/maps-post/doCreateMap.ts +++ b/handlers/maps-post/doCreateMap.ts @@ -1,16 +1,20 @@ -import type { RequestHandler } from "express"; +import type { + RequestHandler +} from "express"; -import { addMap } from "../../helpers/lotOccupancyDB/addMap.js"; +import { + addMap +} from "../../helpers/lotOccupancyDB/addMap.js"; export const handler: RequestHandler = async (request, response) => { - const mapId = addMap(request.body, request.session); + const mapId = addMap(request.body, request.session); - response.json({ - success: true, - mapId - }); + response.json({ + success: true, + mapId + }); }; diff --git a/handlers/maps-post/doUpdateMap.ts b/handlers/maps-post/doUpdateMap.ts index 86e0f14d..9108961d 100644 --- a/handlers/maps-post/doUpdateMap.ts +++ b/handlers/maps-post/doUpdateMap.ts @@ -1,16 +1,20 @@ -import type { RequestHandler } from "express"; +import type { + RequestHandler +} from "express"; -import { updateMap } from "../../helpers/lotOccupancyDB/updateMap.js"; +import { + updateMap +} from "../../helpers/lotOccupancyDB/updateMap.js"; export const handler: RequestHandler = async (request, response) => { - const success = updateMap(request.body, request.session); + const success = updateMap(request.body, request.session); - response.json({ - success, - mapId: request.body.mapId - }); + response.json({ + success, + mapId: request.body.mapId + }); }; diff --git a/views/lot-edit.ejs b/views/lot-edit.ejs index 793e50cb..a5ec5d7c 100644 --- a/views/lot-edit.ejs +++ b/views/lot-edit.ejs @@ -288,35 +288,35 @@ <% for (const lotOccupancy of lot.lotOccupancies) { %> <% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %> - - <% if (isActive) { %> - "> - <% } else { %> - "> - <% } %> - - - - <%= lotOccupancy.occupancyType %> - - - <%= lotOccupancy.occupancyStartDateString %> - - <% if (lotOccupancy.occupancyEndDate) { %> - <%= lotOccupancy.occupancyEndDateString %> - <% } else { %> - (No End Date) - <% } %> - - - <% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %> - (No <%= configFunctions.getProperty("aliases.occupants") %>) - <% } else { %> - <% const occupant = lotOccupancy.lotOccupancyOccupants[0]; %> - <%= occupant.occupantName %> - <%= (lotOccupancy.lotOccupancyOccupants.length > 1 ? " plus " + (lotOccupancy.lotOccupancyOccupants.length - 1) : "") %> - <% } %> - + + <% if (isActive) { %> + "> + <% } else { %> + "> + <% } %> + + + + <%= lotOccupancy.occupancyType %> + + + <%= lotOccupancy.occupancyStartDateString %> + + <% if (lotOccupancy.occupancyEndDate) { %> + <%= lotOccupancy.occupancyEndDateString %> + <% } else { %> + (No End Date) + <% } %> + + + <% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %> + (No <%= configFunctions.getProperty("aliases.occupants") %>) + <% } else { %> + <% const occupant = lotOccupancy.lotOccupancyOccupants[0]; %> + <%= occupant.occupantName %> + <%= (lotOccupancy.lotOccupancyOccupants.length > 1 ? " plus " + (lotOccupancy.lotOccupancyOccupants.length - 1) : "") %> + <% } %> + <% } %> diff --git a/views/lotOccupancy-edit.ejs b/views/lotOccupancy-edit.ejs index 3321f1cc..001b8682 100644 --- a/views/lotOccupancy-edit.ejs +++ b/views/lotOccupancy-edit.ejs @@ -212,7 +212,7 @@ - + <% } %> diff --git a/views/lotOccupancy-view.ejs b/views/lotOccupancy-view.ejs index 72f834ea..b6d9f975 100644 --- a/views/lotOccupancy-view.ejs +++ b/views/lotOccupancy-view.ejs @@ -86,7 +86,11 @@

End Date
- <%= (lotOccupancy.occupancyEndDateString === "" ? "(No End Date)" : lotOccupancy.occupancyEndDateString) %> + <% if (lotOccupancy.occupancyEndDateString === "") { %> + (No End Date) + <% } else { %> + <%= lotOccupancy.occupancyEndDateString %> + <% } %>

<% if (lotOccupancy.lotOccupancyFields.length > 0) { %>