From 73bceadedfdc057d6284189402b53c74865812ec Mon Sep 17 00:00:00 2001 From: Christopher-walsh22 <106549296+Christopher-walsh22@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:55:50 -0700 Subject: [PATCH] BRS-424: Passes are bookable prior to 7am (#414) * Add time to facility get * Indentation error! --- samNode/handlers/readFacility/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/samNode/handlers/readFacility/index.js b/samNode/handlers/readFacility/index.js index b50d1e1..1d8baf9 100644 --- a/samNode/handlers/readFacility/index.js +++ b/samNode/handlers/readFacility/index.js @@ -49,7 +49,12 @@ exports.handler = async (event, context) => { queryObj = visibleFilter(queryObj, permissionObject.isAuthenticated); const facilityData = await runQuery(queryObj); logger.info('Returning results', facilityData.length); + const currentTime = new Date().toISOString(); + facilityData.forEach(facility => { + facility.currentTime = currentTime; + }); return sendResponse(200, facilityData, context); + } else { logger.info('Invalid Request'); return sendResponse(400, { msg: 'Invalid Request' }, context); @@ -80,6 +85,10 @@ exports.handler = async (event, context) => { queryObj = visibleFilter(queryObj, permissionObject.isAuthenticated); const facilityData = await runQuery(queryObj); logger.info('Returning results', facilityData.length); + const currentTime = new Date().toISOString(); + facilityData.forEach(facility => { + facility.currentTime = currentTime; + }); return sendResponse(200, facilityData, context); } else { logger.info('Invalid Request');