From d88a7fbd098413e97a9edcb1fac5f917f53f1510 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 15 Oct 2022 09:33:42 +0200 Subject: Warning store paging --- store/warnings.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'store') diff --git a/store/warnings.js b/store/warnings.js index 1e8fe07..65f1c92 100644 --- a/store/warnings.js +++ b/store/warnings.js @@ -50,8 +50,10 @@ export const actions = { commit("loadingStatus", true, { root: true }); let res = { status: 0, data: null }; let api = this.$config.api; + const page = payload.page ?? 0; + delete payload.page; - await fetch(`${api}/v1/warnings/filter`, { + await fetch(`${api}/v1/warnings/filter?page=${page}`, { method: "POST", headers: { "Content-Type": "application/json", @@ -63,7 +65,7 @@ export const actions = { res.status = response.status; const data = await response.json(); if (res.status == 200) { - commit("saveWarnings", { results: data.results }); + commit("saveWarnings", data); } }) .catch((e) => { -- cgit v1.2.3-18-g5258