Skip to content

Commit 70602d9

Browse files
committed
chore: fix invalid URL bug in getUserLoggedIn
1 parent 32bfc70 commit 70602d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ui/services/user.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const getUsers = async (
4343
setErrorMessage: SetStateCallback<string>,
4444
query: Record<string, string> = {},
4545
): Promise<void> => {
46+
// todo fix
4647
const url = new URL(`${API_BASE}/api/v1/user`);
4748
url.search = new URLSearchParams(query).toString();
4849

@@ -70,6 +71,7 @@ const getUsers = async (
7071

7172
const updateUser = async (data: UserData): Promise<void> => {
7273
console.log(data);
74+
// todo fix
7375
const url = new URL(`${API_BASE}/api/auth/gitAccount`);
7476

7577
try {
@@ -89,10 +91,11 @@ const getUserLoggedIn = async (
8991
setIsError: SetStateCallback<boolean>,
9092
setAuth: SetStateCallback<boolean>,
9193
): Promise<void> => {
92-
const url = new URL(`${API_BASE}/api/auth/me`);
93-
9494
try {
95-
const response: AxiosResponse<UserData> = await axios(url.toString(), getAxiosConfig());
95+
const response: AxiosResponse<UserData> = await axios(
96+
`${API_BASE}/api/auth/me`,
97+
getAxiosConfig(),
98+
);
9699
const data = response.data;
97100
setIsLoading(false);
98101
setIsAdmin(data.admin || false);

0 commit comments

Comments
 (0)