Skip to content

Commit 7626313

Browse files
committed
Client : HOTFIX get request without authentication to fix register bug
1 parent cde00ed commit 7626313

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

client/src/services/apiService.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ export const getRequest = (url: string, options?: AxiosRequestConfig) => {
2323
return api.get(url, merge({}, defaultOptions, options));
2424
};
2525

26+
export const getRequestWithoutAuth = (
27+
url: string,
28+
options?: AxiosRequestConfig,
29+
) => {
30+
const defaultOptions: AxiosRequestConfig = {
31+
headers: {
32+
Accept: "application/json",
33+
},
34+
};
35+
36+
return api.get(url, merge({}, defaultOptions, options));
37+
};
38+
2639
export const postRequest = <T>(
2740
url: string,
2841
data?: T,

client/src/services/seb-server/api-services/institutionService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Institution } from "@/models/seb-server/institution";
44
const baseUrl = "/info" as const;
55

66
export const getInstitutions = async (): Promise<Institution[]> =>
7-
(await apiService.getRequest(`${baseUrl}/institution`)).data;
7+
(await apiService.getRequestWithoutAuth(`${baseUrl}/institution`)).data;
88

99
export const getInstitutionLogo = async (
1010
institutionSuffix: string,

0 commit comments

Comments
 (0)