feat(weather): change to freeipapi, move getApproxLocation to actions

This commit is contained in:
ItzCrazyKns
2026-03-26 22:34:01 +05:30
parent d16b7e271a
commit 72ac815294
3 changed files with 19 additions and 12 deletions

View File

@@ -20,3 +20,17 @@ export const getSuggestions = async (chatHistory: [string, string][]) => {
return data.suggestions;
};
export const getApproxLocation = async () => {
const res = await fetch('https://free.freeipapi.com/api/json', {
method: 'GET',
});
const data = await res.json();
return {
latitude: data.latitude,
longitude: data.longitude,
city: data.cityName,
};
};