feat(services): añadida conexión con el back para el listado de usuarios

parent c7b56a91
Showing with 15 additions and 0 deletions
......@@ -5,4 +5,18 @@ export const userService = {
const response = await api.get('/user/me');
return response.data;
},
readAll: async (page, size, sortBy, sortDirection) => {
// Construye los parámetros de la URL
const params = new URLSearchParams();
if (page) params.append('page', page);
if (size) params.append('size', size);
if (sortBy) {
params.append('sortBy', sortBy);
params.append('sortDirection', sortDirection);
}
// Petición al endpoint con los parámetros
const response = await api.get(`/user?${params.toString()}`);
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