a little hacky but it works

This commit is contained in:
Will Freeman
2024-09-30 21:35:40 -05:00
parent acfff6bb40
commit 6d8b3ba42f
7 changed files with 372 additions and 11 deletions
+26
View File
@@ -0,0 +1,26 @@
import axios from "axios";
export interface BoundingBox {
minLat: number;
maxLat: number;
minLng: number;
maxLng: number;
}
const apiService = axios.create({
baseURL: "http://localhost:8080",
headers: {
"Content-Type": "application/json",
},
});
export const getALPRs = async (boundingBox: BoundingBox) => {
const queryParams = new URLSearchParams({
minLat: boundingBox.minLat.toString(),
maxLat: boundingBox.maxLat.toString(),
minLng: boundingBox.minLng.toString(),
maxLng: boundingBox.maxLng.toString(),
});
const response = await apiService.get(`/alpr?${queryParams.toString()}`);
return response.data;
}