refactor: Quellcode aufräumen
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// /services/api/fetchDeviceNameById.js
|
||||
// /services/database/fetchDeviceNameById.js
|
||||
export const fetchDeviceNameById = async (idLD) => {
|
||||
try {
|
||||
const response = await fetch(`/api/talas_v5_DB/locationDevice/locationDeviceNameById?idLD=${idLD}`);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// /services/api/fetchPoiData.js
|
||||
// /services/database/fetchPoiDataService.js
|
||||
|
||||
export const fetchPoiData = async (idPoi) => {
|
||||
export const fetchPoiDataService = async (idPoi) => {
|
||||
try {
|
||||
const response = await fetch(`/api/talas_v5_DB/pois/getPoiById?idPoi=${idPoi}`);
|
||||
if (!response.ok) throw new Error("Fehler beim Abrufen der POI-Daten");
|
||||
@@ -1,6 +1,6 @@
|
||||
// /services/api/updateLocationInDatabase.js
|
||||
// /services/database/updateLocationInDatabaseService.js
|
||||
|
||||
export const updateLocationInDatabase = async (id, newLatitude, newLongitude) => {
|
||||
export const updateLocationInDatabaseService = async (id, newLatitude, newLongitude) => {
|
||||
const response = await fetch("/api/talas_v5_DB/pois/updateLocation", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
@@ -1,4 +1,4 @@
|
||||
// services/api/fetchWithTimeout.js
|
||||
// services/utils/fetchWithTimeout.js
|
||||
|
||||
const fetchWithTimeout = (url, options, timeout = 5000) => {
|
||||
const controller = new AbortController();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// /services/api/fetchGisStationsMeasurementsService.js
|
||||
// /services/webservice/fetchGisStationsMeasurementsService.js
|
||||
|
||||
export const fetchGisStationsMeasurementsService = async () => {
|
||||
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// /services/api/fetchGisStationsStaticDistrictService.js
|
||||
// /services/webservice/fetchGisStationsStaticDistrictService.js
|
||||
|
||||
/**
|
||||
* Holt statische GIS-Stationen-Daten für Bezirke.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// /services/api/fetchGisStationsStatusDistrictService.js
|
||||
// /services/webservice/fetchGisStationsStatusDistrictService.js
|
||||
|
||||
/**
|
||||
* Holt Statusinformationen der GIS-Bezirksstationen.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// /services/api/fetchGisStatusStations.js
|
||||
// /services/webservice/fetchGisStatusStationsService.js
|
||||
import fetchWithTimeout from "../utils/fetchWithTimeout";
|
||||
|
||||
export const fetchGisStatusStations = async (idMap, idUser) => {
|
||||
export const fetchGisStatusStationsService = async (idMap, idUser) => {
|
||||
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
|
||||
|
||||
const SERVER_URL = mode === "dev" ? `${window.location.protocol}//${window.location.hostname}:80` : `${window.location.origin}`;
|
||||
@@ -1,6 +1,6 @@
|
||||
// /services/api/fetchGisSystemStatic.js
|
||||
// /services/webservice/fetchGisSystemStaticService.js
|
||||
|
||||
export const fetchGisSystemStatic = async (url, setGisSystemStatic, setGisSystemStaticLoaded) => {
|
||||
export const fetchGisSystemStaticService = async (url, setGisSystemStatic, setGisSystemStaticLoaded) => {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const jsonResponse = await response.json();
|
||||
@@ -1,7 +1,7 @@
|
||||
// /services/api/fetchUserRights.js
|
||||
// /services/webservice/fetchUserRightsService.js
|
||||
import * as config from "../../config/config";
|
||||
|
||||
export const fetchUserRights = async () => {
|
||||
export const fetchUserRightsService = async () => {
|
||||
if (config.USE_MOCK_API) {
|
||||
console.log("⚠️ Mock-API: Benutzerrechte geladen");
|
||||
return [56, 57, 58]; // Beispielrechte
|
||||
Reference in New Issue
Block a user