refactor wifi location parsing

This commit is contained in:
2025-01-02 16:31:55 +01:00
parent 3f3c47d629
commit ad32baa844
3 changed files with 41 additions and 37 deletions

View File

@ -54,9 +54,14 @@ export const getLocationForWifi = async (
Authorization: `Basic ${process.env.WIGLE_TOKEN}`,
},
});
return await response.json();
if (response.ok) {
return await response.json();
}
console.log(response.status);
return undefined;
} catch (error) {
console.error("Fehler beim Aufruf des Services:", error);
console.error("Error during call of API wigle.net:", error);
}
};