feat(user.js): añadidas al servicio las funciones para activar/desactivar usuarios

parent 572f31c6
Showing with 9 additions and 0 deletions
...@@ -18,5 +18,13 @@ export const userService = { ...@@ -18,5 +18,13 @@ export const userService = {
// Petición al endpoint con los parámetros // Petición al endpoint con los parámetros
const response = await api.get(`/user?${params.toString()}`); const response = await api.get(`/user?${params.toString()}`);
return response.data; return response.data;
},
deactivate: async (id) => {
const response = await api.patch(`/user/${id}/deactivate`);
return response.data;
},
activate: async (id) => {
const response = await api.patch(`/user/${id}/activate`);
return response.data;
} }
} }
\ No newline at end of file
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