fix: POI bearbeiten in den Modal , aktualisieren und entfernen
This commit is contained in:
@@ -34,23 +34,24 @@ export const fetchPriorityConfig = async () => {
|
|||||||
|
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
export const fetchPoiData = async (idPoi) => {
|
export const fetchPoiData = async (idPoi) => {
|
||||||
const response = await fetch(
|
try {
|
||||||
`/api/talas_v5_DB/pois/getPoiById?idPoi=${idPoi}`
|
const response = await fetch(
|
||||||
);
|
`/api/talas_v5_DB/pois/getPoiById?idPoi=${idPoi}`
|
||||||
if (!response.ok) {
|
);
|
||||||
console.error("Fehler beim Abrufen der POI-Daten");
|
if (!response.ok) {
|
||||||
return;
|
throw new Error("Fehler beim Abrufen der POI-Daten");
|
||||||
|
}
|
||||||
|
const data = await response.json();
|
||||||
|
return {
|
||||||
|
idPoi,
|
||||||
|
name: data.name,
|
||||||
|
description: data.description,
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Fehler beim Abrufen der POI-Daten", error);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
const data = await response.json();
|
|
||||||
setCurrentPoiData({
|
|
||||||
idPoi,
|
|
||||||
name: data.name,
|
|
||||||
description: data.description,
|
|
||||||
});
|
|
||||||
//console.log("POI-Daten2:", currentPoiData);
|
|
||||||
setShowPoiUpdateModal(true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
// Funktion zum Aktualisieren der Position in der Datenbank
|
// Funktion zum Aktualisieren der Position in der Datenbank
|
||||||
export const updateLocationInDatabase = async (
|
export const updateLocationInDatabase = async (
|
||||||
|
|||||||
Reference in New Issue
Block a user