generalize the urls
This commit is contained in:
3
.env
3
.env
@@ -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
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const authProvider: AuthProvider = {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
response = await fetch(
|
response = await fetch(
|
||||||
new Request("http://localhost:8080/atsp-idp/token", {
|
new Request(`${import.meta.env.VITE_AUTH_URL}/atsp-idp/token`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
body: new URLSearchParams({
|
body: new URLSearchParams({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useQueryEngine } from './hooks';
|
|||||||
|
|
||||||
export const dataProviderExtension = () => {
|
export const dataProviderExtension = () => {
|
||||||
const { fetchCommon } = useQueryEngine();
|
const { fetchCommon } = useQueryEngine();
|
||||||
const url = import.meta.env.VITE_SIMPLE_REST_URL;
|
const url = import.meta.env.VITE_GATEWAY_REST_URL;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
personList: (params: URLSearchParams) => fetchCommon(`${url}/person?${params}`),
|
personList: (params: URLSearchParams) => fetchCommon(`${url}/person?${params}`),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const fetchJson = (url, options = {}) => {
|
|||||||
|
|
||||||
export const dataProvider = withLifecycleCallbacks(
|
export const dataProvider = withLifecycleCallbacks(
|
||||||
{
|
{
|
||||||
...simpleRestProvider(import.meta.env.VITE_SIMPLE_REST_URL, fetchJson),
|
...simpleRestProvider(import.meta.env.VITE_GATEWAY_REST_URL, fetchJson),
|
||||||
...dataProviderExtension(),
|
...dataProviderExtension(),
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user