Skip to content

Commit

Permalink
Merge pull request #350 from CodeForAfrica/fix/air_quality_page
Browse files Browse the repository at this point in the history
fix: Apply Correct API URL format for city selection in CityMenuBar
  • Loading branch information
thepsalmist authored Nov 27, 2024
2 parents 8c9dfd4 + f3ec0ec commit d8bb379
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/air/city/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ function City({ city: citySlug, data, ...props }) {
setCityP2Stats({ average: "--", averageDescription: "loading" });
setCityTemperatureStats({});
setCityHumidityStats({});
fetch(`/api/air-quality?city${city}`)
fetch(`/api/air/quality?city=${city}`)
.then((res) => res.json())
.then((json) => {
setCityHumidityStats(getFormattedHumidityStats(json));
setCityP2Stats(getFormattedP2Stats(json));
setCityTemperatureStats(getFormattedTemperatureStats(json));
})
.then(() =>
fetch(`/api/weekly-p2-data?city${city}`)
fetch(`/api/air/weekly-p2-data?city=${city}`)
.then((res) => res.json())
.then((json) =>
setCityP2WeeklyStats(getFormattedWeeklyP2Stats(json)),
Expand Down

0 comments on commit d8bb379

Please sign in to comment.