Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Alba María Álvarez
/
front_recipes
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8e37b66b
authored
Aug 29, 2025
by
Alba María Álvarez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat(stores): añadidos parámetros para listado de usuarios y paginación/ordenación
parent
fb08cfd3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
src/stores/userStore.js
src/stores/userStore.js
View file @
8e37b66b
...
...
@@ -4,6 +4,13 @@ import { userService } from '@/services/user';
export
const
useUserStore
=
defineStore
(
'user'
,
{
state
:
()
=>
({
user
:
null
,
users
:
[],
currentPage
:
0
,
pageSize
:
5
,
totalElements
:
0
,
totalPages
:
0
,
sortBy
:
null
,
sortDirection
:
'asc'
}),
actions
:
{
async
readUser
()
{
...
...
@@ -15,6 +22,23 @@ export const useUserStore = defineStore('user', {
this
.
user
=
null
;
throw
error
;
}
},
async
readAll
(
page
,
size
,
sortBy
,
sortDirection
)
{
try
{
const
response
=
await
userService
.
readAll
(
page
,
size
,
sortBy
,
sortDirection
);
this
.
users
=
response
.
content
;
this
.
totalElements
=
response
.
totalElements
;
this
.
totalPages
=
response
.
totalPages
;
this
.
currentPage
=
response
.
number
;
this
.
sortBy
=
sortBy
;
this
.
sortDirection
=
sortDirection
;
}
catch
(
error
)
{
console
.
error
(
'Error al obtener la lista de usuarios:'
,
error
);
this
.
users
=
[];
this
.
totalElements
=
0
;
this
.
totalPages
=
0
;
throw
error
;
}
}
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment