From f3ec0ec47944765a8a4cbabd788dce469aa0513d Mon Sep 17 00:00:00 2001 From: Michael Hudson Nkotagu Date: Tue, 26 Nov 2024 15:28:32 +0300 Subject: [PATCH] fix: Correct API URL format for city selection in CityMenuBar --- src/pages/air/city/[id].js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/air/city/[id].js b/src/pages/air/city/[id].js index 13fa569f..0351e6c8 100644 --- a/src/pages/air/city/[id].js +++ b/src/pages/air/city/[id].js @@ -165,7 +165,7 @@ 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)); @@ -173,7 +173,7 @@ function City({ city: citySlug, data, ...props }) { 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)),