Skip to content

Commit

Permalink
fix: Revert back to older version of repo
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnbarHome committed Feb 2, 2024
1 parent 08aa653 commit f4c3a8c
Show file tree
Hide file tree
Showing 4 changed files with 499 additions and 573 deletions.
45 changes: 7 additions & 38 deletions be/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,45 +106,14 @@ router.post("/atms/filter", async (req, res) => {
headers: { "Content-Type": "application/json" }
};

const filteredAtms = await axios(filterATMsConfig);

const formattedAtms = formatDataForDisplay(filteredAtms.data, true);

res.json(formattedAtms);

} catch (error) {
console.error("Error in /atms/filter route:", error.message);
res.status(500).send("Error processing request");
}
});


router.post("/branches/filter", async (req, res) => {
try {
const branchFilterCriteria = {
Accessibility: req.body.Accessibility,
ServiceAndFacility: req.body.ServiceAndFacility,
Latitude: req.body.Latitude,
Longitude: req.body.Longitude,
Radius: req.body.Radius,
};

const requestData = {
body: branchFilterCriteria,
headers: { "Content-Type": "application/json" }
};

const data = await withCache(fetchFromAPI, "branches/filter", requestData, 'POST');
const data = await withCache(fetchFromAPI, "atms/filter", requestData, 'POST');
res.json(data);
} catch (error) {
console.error("Error in /branches/filter route:", error.message);
console.error("Error in /atms/filter route:", error.message);
res.status(500).send("Error processing request");
}
});




// Route for getting filtered branches
router.post("/branches/filter", async (req, res) => {
try {
Expand All @@ -162,11 +131,11 @@ router.post("/branches/filter", async (req, res) => {
return response.data;
}, "branches/filter", branchFilterCriteria, 'POST');

const filteredBranches = await axios(filterBranchesConfig);

const formattedBranches = formatDataForDisplay(filteredBranches.data, false);

res.json(formattedBranches);
res.json(data);
} catch (error) {
console.error("Error in /branches/filter route:", error.message);
res.status(500).send("Error processing request");
}
});


Expand Down
2 changes: 1 addition & 1 deletion fe/dist/style.css

Large diffs are not rendered by default.

Loading

0 comments on commit f4c3a8c

Please sign in to comment.