- updated base for endpoints

- added loading states
- need to add new form for ftp type
This commit is contained in:
2025-11-27 09:43:09 +00:00
parent 97ff9a981d
commit 3c10ff82cb
8 changed files with 217 additions and 196 deletions

View File

@@ -1,8 +1,9 @@
import { useQuery, useMutation } from "@tanstack/react-query";
import type { DispatcherConfig } from "../../../types/types";
import { CAMBASE } from "../../../utils/config";
const getDispatcherConfig = async () => {
const response = await fetch(`http://192.168.202.121/api/fetch-config?id=Dispatcher0`);
const response = await fetch(`${CAMBASE}/api/fetch-config?id=Dispatcher0`);
if (!response.ok) {
throw new Error("Network response was not ok");
}
@@ -23,7 +24,7 @@ const postDispatcherConfig = async (config: DispatcherConfig) => {
},
],
};
const response = await fetch(`http://192.168.202.121/api/update-config`, {
const response = await fetch(`${CAMBASE}/api/update-config`, {
method: "POST",
body: JSON.stringify(updateConfigPayload),
});