generalize the urls

This commit is contained in:
2025-01-14 11:19:50 +01:00
parent 3b28d6d467
commit ada610d01f
4 changed files with 5 additions and 4 deletions

3
.env
View File

@@ -1 +1,2 @@
VITE_SIMPLE_REST_URL=http://localhost:8081/core/api/admin
VITE_AUTH_URL=http://localhost:8080
VITE_GATEWAY_REST_URL=http://localhost:8081/core/api/admin

View File

@@ -8,7 +8,7 @@ export const authProvider: AuthProvider = {
try {
response = await fetch(
new Request("http://localhost:8080/atsp-idp/token", {
new Request(`${import.meta.env.VITE_AUTH_URL}/atsp-idp/token`, {
method: "POST",
credentials: "include",
body: new URLSearchParams({

View File

@@ -2,7 +2,7 @@ import { useQueryEngine } from './hooks';
export const dataProviderExtension = () => {
const { fetchCommon } = useQueryEngine();
const url = import.meta.env.VITE_SIMPLE_REST_URL;
const url = import.meta.env.VITE_GATEWAY_REST_URL;
return {
personList: (params: URLSearchParams) => fetchCommon(`${url}/person?${params}`),

View File

@@ -17,7 +17,7 @@ const fetchJson = (url, options = {}) => {
export const dataProvider = withLifecycleCallbacks(
{
...simpleRestProvider(import.meta.env.VITE_SIMPLE_REST_URL, fetchJson),
...simpleRestProvider(import.meta.env.VITE_GATEWAY_REST_URL, fetchJson),
...dataProviderExtension(),
},
[