remove user ID param from rotues

This commit is contained in:
Alex Holliday
2025-07-21 11:05:10 -07:00
parent bfa6832beb
commit 12b7819791
2 changed files with 4 additions and 8 deletions

View File

@@ -44,7 +44,6 @@ export const login = createAsyncThunk("auth/login", async (form, thunkApi) => {
export const update = createAsyncThunk("auth/update", async (data, thunkApi) => {
const { localData: form } = data;
const user = thunkApi.getState().auth.user;
try {
const fd = new FormData();
form.firstName && fd.append("firstName", form.firstName);
@@ -60,7 +59,6 @@ export const update = createAsyncThunk("auth/update", async (data, thunkApi) =>
form.deleteProfileImage && fd.append("deleteProfileImage", form.deleteProfileImage);
const res = await networkService.updateUser({
userId: user._id,
form: fd,
});
return res.data;
@@ -77,10 +75,8 @@ export const update = createAsyncThunk("auth/update", async (data, thunkApi) =>
});
export const deleteUser = createAsyncThunk("auth/delete", async (_, thunkApi) => {
const user = thunkApi.getState().auth.user;
try {
const res = await networkService.deleteUser({ userId: user._id });
const res = await networkService.deleteUser();
return res.data;
} catch (error) {
if (error.response && error.response.data) {

View File

@@ -393,7 +393,7 @@ class NetworkService {
*
*/
async updateUser(config) {
return this.axiosInstance.put(`/auth/user/${config.userId}`, config.form);
return this.axiosInstance.put(`/auth/user`, config.form);
}
/**
@@ -406,8 +406,8 @@ class NetworkService {
* @param {string} config.userId - The ID of the user to be deleted.
*
**/
async deleteUser(config) {
return this.axiosInstance.delete(`/auth/user/${config.userId}`);
async deleteUser() {
return this.axiosInstance.delete(`/auth/user`);
}
/**