undefined return type
parent
812ea8618e
commit
c5037f779f
|
|
@ -1,4 +1,4 @@
|
||||||
import type * as recordTypes from "../../types/recordTypes";
|
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 declare const getLot: (lotId: number | string) => recordTypes.Lot;
|
||||||
export default getLot;
|
export default getLot;
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,7 @@ const baseSQL =
|
||||||
" left join Maps m on l.mapId = m.mapId" +
|
" left join Maps m on l.mapId = m.mapId" +
|
||||||
" where l.recordDelete_timeMillis is null";
|
" where l.recordDelete_timeMillis is null";
|
||||||
|
|
||||||
const _getLot = (
|
const _getLot = (sql: string, lotId_or_lotName: number | string): recordTypes.Lot | undefined => {
|
||||||
sql: string,
|
|
||||||
lotId_or_lotName: number | string
|
|
||||||
): recordTypes.Lot => {
|
|
||||||
const database = sqlite(databasePath, {
|
const database = sqlite(databasePath, {
|
||||||
readonly: true
|
readonly: true
|
||||||
});
|
});
|
||||||
|
|
@ -52,7 +49,7 @@ const _getLot = (
|
||||||
return lot;
|
return lot;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getLotByLotName = (lotName: string): recordTypes.Lot => {
|
export const getLotByLotName = (lotName: string): recordTypes.Lot | undefined => {
|
||||||
return _getLot(baseSQL + " and l.lotName = ?", lotName);
|
return _getLot(baseSQL + " and l.lotName = ?", lotName);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue