fix: update error response status and improve success message handling in weather fetching
This commit is contained in:
@@ -14,7 +14,7 @@ router.get("/fetchWeather", async (req, res) => {
|
||||
`https://api.openweathermap.org/geo/1.0/direct?q=${city}&appid=${apiKey}`
|
||||
);
|
||||
if (!locationResponse.ok) {
|
||||
return res.status(404).json({
|
||||
return res.status(500).json({
|
||||
error: "Error fetching location data. (Error: x32)",
|
||||
success: "false",
|
||||
data: null,
|
||||
|
Reference in New Issue
Block a user