diff --git a/helpers/lotOccupancyDB/getLot.d.ts b/helpers/lotOccupancyDB/getLot.d.ts index d31d3c8b..4fedfa78 100644 --- a/helpers/lotOccupancyDB/getLot.d.ts +++ b/helpers/lotOccupancyDB/getLot.d.ts @@ -1,4 +1,4 @@ import type * as recordTypes from "../../types/recordTypes"; -export declare const getLotByLotName: (lotName: string) => recordTypes.Lot; +export declare const getLotByLotName: (lotName: string) => recordTypes.Lot | undefined; export declare const getLot: (lotId: number | string) => recordTypes.Lot; export default getLot; diff --git a/helpers/lotOccupancyDB/getLot.ts b/helpers/lotOccupancyDB/getLot.ts index f9b9a238..2675fa58 100644 --- a/helpers/lotOccupancyDB/getLot.ts +++ b/helpers/lotOccupancyDB/getLot.ts @@ -21,10 +21,7 @@ const baseSQL = " left join Maps m on l.mapId = m.mapId" + " where l.recordDelete_timeMillis is null"; -const _getLot = ( - sql: string, - lotId_or_lotName: number | string -): recordTypes.Lot => { +const _getLot = (sql: string, lotId_or_lotName: number | string): recordTypes.Lot | undefined => { const database = sqlite(databasePath, { readonly: true }); @@ -52,7 +49,7 @@ const _getLot = ( return lot; }; -export const getLotByLotName = (lotName: string): recordTypes.Lot => { +export const getLotByLotName = (lotName: string): recordTypes.Lot | undefined => { return _getLot(baseSQL + " and l.lotName = ?", lotName); };