Submitting identifier and fetching customer data

This commit is contained in:
2025-06-16 21:28:47 +03:00
parent 069fff7294
commit 667e341445
10 changed files with 394 additions and 203 deletions

17
app/api.ts Normal file
View File

@@ -0,0 +1,17 @@
export const fetchCustomerData = async (id: string) => {
const baseUrl = "http://localhost:9090";
try {
const response = await fetch(`${baseUrl}/loota/${id}`, {
method: 'GET',
mode: "cors",
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
return data;
} catch (error) {
throw error;
}
}