perf(user): cambio en parámetros recibidos del backend para validación de contraseñas

parent e64f1e1b
Showing with 7 additions and 3 deletions
......@@ -35,8 +35,8 @@ export const userService = {
const response = await api.put('/user', updatedUser);
return response.data;
},
changePassword: async (oldPassword, newPassword) => {
const response = await api.patch(`user/password?oldPassword=${oldPassword}&newPassword=${newPassword}`);
changePassword: async (passwords) => {
const response = await api.patch(`user/password`, passwords);
return response.data;
},
changeRole: async (id, role) => {
......
......@@ -73,7 +73,11 @@ export const useUserStore = defineStore('user', {
},
async changePassword(oldPassword, newPassword) {
try {
await userService.changePassword(oldPassword, newPassword);
const passwords = {
oldPassword: oldPassword,
newPassword: newPassword
};
await userService.changePassword(passwords);
} catch (error) {
throw error;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment