Skip to content

Commit

Permalink
fix: use correct path
Browse files Browse the repository at this point in the history
  • Loading branch information
cleydyr committed May 29, 2024
1 parent dbce329 commit fddd6c8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/frontend/src/administration/reports/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const DEFAULT_FETCH_OPTIONS: InitOverrideFunction = async ({ init }) => ({
},
});

function apiHost() {
return `http://localhost:8090/api/v2`;
function baseEndpointPath() {
return `${window.location.origin}/api/v2`;
}

type UseMutationOptions<TVariables, TData, TError = Error> = Parameters<
Expand All @@ -36,7 +36,7 @@ export const useFillReportMutation = (
const queryClient = useQueryClient();

const apiConfiguration = new Configuration({
basePath: apiHost(),
basePath: baseEndpointPath(),
});

const api = new ReportFillApi(apiConfiguration);
Expand Down Expand Up @@ -65,7 +65,7 @@ const useUpdateReportMutation = (
const queryClient = useQueryClient();

const apiConfiguration = new Configuration({
basePath: apiHost(),
basePath: baseEndpointPath(),
});

const api = new ReportTemplateApi(apiConfiguration);
Expand Down Expand Up @@ -93,7 +93,7 @@ const useDeleteReportMutation = (
const queryClient = useQueryClient();

const apiConfiguration = new Configuration({
basePath: apiHost(),
basePath: baseEndpointPath(),
});

const api = new ReportTemplateApi(apiConfiguration);
Expand All @@ -116,7 +116,7 @@ const useDeleteReportMutation = (

const useListReportsQuery = () => {
const apiConfiguration = new Configuration({
basePath: apiHost(),
basePath: baseEndpointPath(),
});

const api = new ReportTemplateApi(apiConfiguration);
Expand All @@ -133,7 +133,7 @@ const useAddReportMutation = (
const queryClient = useQueryClient();

const apiConfiguration = new Configuration({
basePath: apiHost(),
basePath: baseEndpointPath(),
});

const api = new ReportTemplateApi(apiConfiguration);
Expand Down

0 comments on commit fddd6c8

Please sign in to comment.