From 36b5f74414413e7270d47f52df387697698aeeaf Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 4 Oct 2022 22:31:35 +0200 Subject: Add pagination --- store/users.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'store') 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", }, -- cgit v1.2.3-18-g5258