From b2dca99949b3509f707455ef904895ae48925d74 Mon Sep 17 00:00:00 2001 From: dallascrichmond <113049138+dallascrichmond@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:00:23 -0700 Subject: [PATCH] Changed datesArr to updateArr --- src/api/controllers/location-controller.ts | 2 +- src/frontend-pwa/src/services/app/useAppService.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/controllers/location-controller.ts b/src/api/controllers/location-controller.ts index 08bcd91a..41b49091 100644 --- a/src/api/controllers/location-controller.ts +++ b/src/api/controllers/location-controller.ts @@ -103,7 +103,7 @@ export const updatedInfo = async (req: Request, res: Response) => { const responseObject: ReturnObject = {}; if (req.body.updateArr && typeof req.body.updateArr === typeof []) { const datesArr: Array = await dateModel.find({}); - responseObject.datesArr = datesArr; + responseObject.updateArr = datesArr; const promises = req.body.updateArr.map(async (item: UpdateDate) => { if (servicesOffered.includes(item.serviceType)) { const serviceDate: any = datesArr.find((service: UpdateDate) => ( diff --git a/src/frontend-pwa/src/services/app/useAppService.ts b/src/frontend-pwa/src/services/app/useAppService.ts index 161c4806..e9e58106 100644 --- a/src/frontend-pwa/src/services/app/useAppService.ts +++ b/src/frontend-pwa/src/services/app/useAppService.ts @@ -39,6 +39,7 @@ const useAppService = () => { if (isOnline) { try { const data = await axios.get(`${constants.BACKEND_URL}/api/locations`); + console.log('Data: ', data); saveDataToLocalStorage(constants.APP_DATA_KEY, data); dispatch({ type: SET_APP_DATA, payload: data }); } catch (e) {