Little fix due to better mark

This commit is contained in:
2025-06-17 19:09:27 +02:00
parent 5e2926b9ef
commit 7b275c4e39
4 changed files with 23 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
import axios from "axios";
const API_URL = "https://hopp.zikor.pl";
const API_URL = "http://192.168.0.130:9010";
export async function listLocations() {
try {
@@ -9,6 +9,8 @@ export async function listLocations() {
return "No locations found";
}
console.log("Locations fetched successfully");
return response.data.map(location => ({
...location,
imageSource: normalizeImageSource(location.image)
@@ -63,6 +65,7 @@ export async function addLocation(location) {
console.log("Error adding location");
return("Failed to add location");
}
console.log("Location added successfully:", response.data);
return response.data;
} catch (error) {
console.error("Error adding location:", error);
@@ -79,6 +82,7 @@ export async function updateLocation(id, location) {
console.log("Failed to update location");
return("Failed to update location");
}
console.log("Location updated successfully:", response.data);
return response.data;
} catch (error) {
console.error("Error while updating location:", error);
@@ -93,6 +97,7 @@ export async function deleteLocation(id) {
console.log("Error deleting location");
return("Failed to delete location");
}
console.log("Location deleted successfully:", response.data);
return response.data;
} catch (error) {
console.error("Error while deleting location:", error);