feat: reworked ttn webhook endpoint logic
This commit is contained in:
@ -47,6 +47,7 @@ export const getLocationForWifi = async (
|
||||
try {
|
||||
const url = `${process.env.WIGLE_BASE_URL!}${process.env
|
||||
.WIGLE_NETWORK_SEARCH!}?netid=${encodeURIComponent(mac)}`;
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@ -54,12 +55,12 @@ export const getLocationForWifi = async (
|
||||
Authorization: `Basic ${process.env.WIGLE_TOKEN}`,
|
||||
},
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
return await response.json();
|
||||
}
|
||||
console.log(response.status);
|
||||
return undefined;
|
||||
|
||||
} catch (error) {
|
||||
console.error("Error during call of API wigle.net:", error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user