Search by code was searching for intergers which was returning no results. Now updated to search the database with code as a string.

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2024-11-01 19:47:32 +00:00
parent be1ee0b285
commit a793862aa2

View File

@ -46,7 +46,7 @@ export async function findPisByCode(
logger.debug(`pisServices.findPisByCode: Searching for PIS code: ${code}`);
const cleanCode = clean.removeNonNumeric(code);
const query = {
code: parseInt(cleanCode),
code: cleanCode,
};
const search = db.query("pis", query);
return await search;