Skip to content

Commit cd5f85d

Browse files
committed
update endpoints
1 parent 2271546 commit cd5f85d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

frontend/src/api/auth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function logOut() {
6262
*/
6363

6464
export async function changePassword(newPassword: string, currPassword: string) {
65-
const response = await userServiceClient.post('/changepassword', {
65+
const response = await apiGatewayClient.post('/auth/changepassword', {
6666
newPassword: newPassword,
6767
currPassword: currPassword
6868
})
@@ -75,7 +75,7 @@ export async function changePassword(newPassword: string, currPassword: string)
7575
*/
7676
export async function updateUserProfile(username : string, bio: string | null) {
7777

78-
const response = await userServiceClient.post('/updateProfile', {
78+
const response = await apiGatewayClient.post('/auth/updateProfile', {
7979
username: username,
8080
bio: bio,
8181
})
@@ -84,14 +84,14 @@ export async function updateUserProfile(username : string, bio: string | null) {
8484
}
8585

8686
export async function uploadProfilePic(formData : FormData) {
87-
const response = await userServiceClient.post('/uploadProfilePic', formData)
87+
const response = await apiGatewayClient.post('/auth/uploadProfilePic', formData)
8888

8989
return response;
9090
}
9191

9292
export async function updateUserRole(id : number, role: 'ADMIN' | 'USER') {
9393

94-
const response = await userServiceClient.put('/updateRole', {
94+
const response = await apiGatewayClient.put('/auth/updateRole', {
9595
id: id,
9696
role: role,
9797
})

frontend/src/api/user.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export async function addUserQuestion(
9191
*/
9292
export async function findUsers(query : string) {
9393

94-
const response : AxiosResponse = await userServiceClient.post(
94+
const response : AxiosResponse = await apiGatewayClient.post(
9595
`/api/users/findusers`, {
9696
query
9797
}
@@ -104,7 +104,7 @@ export async function findUsers(query : string) {
104104

105105
export async function getUserProfile(id: string) {
106106

107-
const response : AxiosResponse = await userServiceClient.get(`/api/users/${id}`);
107+
const response : AxiosResponse = await apiGatewayClient.get(`/api/users/${id}`);
108108

109109
return response.data;
110110
}
@@ -114,5 +114,5 @@ export function getProfilePicUrl(profilePicFileName : string | null) {
114114
return undefined;
115115
}
116116

117-
return userServiceClient.getUri({url: `/api/users/uploads/${profilePicFileName}`});
117+
return apiGatewayClient.getUri({url: `/api/users/uploads/${profilePicFileName}`});
118118
}

0 commit comments

Comments
 (0)