refactor: Move API-Endpoint-Functions to /api/talas_v5_DB/ folder for better organization

This commit is contained in:
ISA
2024-06-14 14:06:32 +02:00
parent c8ac4ebdb7
commit d220d0baae
18 changed files with 117 additions and 96 deletions

View File

@@ -5,7 +5,6 @@ import { useRecoilValue, useRecoilState, useSetRecoilState } from "recoil";
import { readPoiMarkersStore } from "../store/selectors/readPoiMarkersStore";
import { poiReadFromDbTriggerAtom } from "../store/atoms/poiReadFromDbTriggerAtom";
const ShowAddStationPopup = ({ onClose, map, latlng }) => {
const [poiTypData, setpoiTypData] = useState(); // Recoil State verwenden
const [name, setName] = useState("");
@@ -21,7 +20,7 @@ const ShowAddStationPopup = ({ onClose, map, latlng }) => {
useEffect(() => {
const fetchpoiTypData = async () => {
try {
const response = await fetch("/api/readPoiTyp");
const response = await fetch("/api/talas_v5_DB/poiTyp/readPoiTyp");
const data = await response.json();
setpoiTypData(data);
if (data && data.length > 0) {
@@ -96,7 +95,7 @@ const ShowAddStationPopup = ({ onClose, map, latlng }) => {
.idLD,
};
const response = await fetch("/api/addLocation", {
const response = await fetch("/api/talas_v5_DB/pois/addLocation", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(formData),