feat(userStore): añadidas al store las llamadas a activar y desactivar

parent 9ee99807
Showing with 15 additions and 0 deletions
...@@ -30,6 +30,7 @@ export const useUserStore = defineStore('user', { ...@@ -30,6 +30,7 @@ export const useUserStore = defineStore('user', {
this.totalElements = response.totalElements; this.totalElements = response.totalElements;
this.totalPages = response.totalPages; this.totalPages = response.totalPages;
this.currentPage = response.number; this.currentPage = response.number;
this.pageSize = size;
this.sortBy = sortBy; this.sortBy = sortBy;
this.sortDirection = sortDirection; this.sortDirection = sortDirection;
} catch (error) { } catch (error) {
...@@ -39,6 +40,20 @@ export const useUserStore = defineStore('user', { ...@@ -39,6 +40,20 @@ export const useUserStore = defineStore('user', {
this.totalPages = 0; this.totalPages = 0;
throw error; throw error;
} }
},
async deactivate(id) {
try {
await userService.deactivate(id);
} catch (error) {
throw error;
}
},
async activate(id) {
try {
await userService.activate(id);
} 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