summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-10-04 22:31:35 +0200
committerSanto Cariotti <santo@dcariotti.me>2022-10-04 22:31:35 +0200
commit36b5f74414413e7270d47f52df387697698aeeaf (patch)
tree050fc93827ca595a198bb2618dd817eeac845423 /store
parent8806bb5f857502eec2ad9132757458d714fff442 (diff)
Add pagination
Diffstat (limited to 'store')
-rw-r--r--store/users.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/store/users.js b/store/users.js
index cf1ca86..90e4dad 100644
--- a/store/users.js
+++ b/store/users.js
@@ -39,12 +39,14 @@ export const actions = {
return res;
},
// Search user models
- async findModels({ commit }, id) {
+ async findModels({ commit }, data) {
commit("loadingStatus", true, { root: true });
let res = { status: 0, data: null };
let api = this.$config.api;
+ const id = data.id;
+ const page = data.page ? data.page : 0;
- await fetch(`${api}/v1/users/${id}/models`, {
+ await fetch(`${api}/v1/users/${id}/models?page=${page}`, {
headers: {
"Content-Type": "application/json",
},