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 = { ...@@ -35,8 +35,8 @@ export const userService = {
const response = await api.put('/user', updatedUser); const response = await api.put('/user', updatedUser);
return response.data; return response.data;
}, },
changePassword: async (oldPassword, newPassword) => { changePassword: async (passwords) => {
const response = await api.patch(`user/password?oldPassword=${oldPassword}&newPassword=${newPassword}`); const response = await api.patch(`user/password`, passwords);
return response.data; return response.data;
}, },
changeRole: async (id, role) => { changeRole: async (id, role) => {
......
...@@ -73,7 +73,11 @@ export const useUserStore = defineStore('user', { ...@@ -73,7 +73,11 @@ export const useUserStore = defineStore('user', {
}, },
async changePassword(oldPassword, newPassword) { async changePassword(oldPassword, newPassword) {
try { try {
await userService.changePassword(oldPassword, newPassword); const passwords = {
oldPassword: oldPassword,
newPassword: newPassword
};
await userService.changePassword(passwords);
} catch (error) { } catch (error) {
throw 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