feat(user): añadido servicio y store para desactivar un usuario por sí mismo

parent a5c4c010
Showing with 12 additions and 0 deletions
...@@ -26,5 +26,9 @@ export const userService = { ...@@ -26,5 +26,9 @@ export const userService = {
activate: async (id) => { activate: async (id) => {
const response = await api.patch(`/user/${id}/activate`); const response = await api.patch(`/user/${id}/activate`);
return response.data; return response.data;
},
deactivateMe: async () => {
const response = await api.patch(`/user/deactivate`);
return response.data;
} }
} }
\ No newline at end of file
...@@ -54,6 +54,13 @@ export const useUserStore = defineStore('user', { ...@@ -54,6 +54,13 @@ export const useUserStore = defineStore('user', {
} catch (error) { } catch (error) {
throw error; throw error;
} }
},
async deactivateMe() {
try {
await userService.deactivateMe();
} 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