diff options
author | Santo Cariotti <santo@dcariotti.me> | 2022-10-04 22:31:35 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2022-10-04 22:31:35 +0200 |
commit | 36b5f74414413e7270d47f52df387697698aeeaf (patch) | |
tree | 050fc93827ca595a198bb2618dd817eeac845423 /store | |
parent | 8806bb5f857502eec2ad9132757458d714fff442 (diff) |
Add pagination
Diffstat (limited to 'store')
-rw-r--r-- | store/users.js | 6 |
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", }, |