Skip to content

Commit

Permalink
BRS-424: Passes are bookable prior to 7am (#414)
Browse files Browse the repository at this point in the history
* Add time to facility get

* Indentation error!
  • Loading branch information
Christopher-walsh22 authored Oct 8, 2024
1 parent 423cb61 commit 73bcead
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions samNode/handlers/readFacility/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 73bcead

Please sign in to comment.