Fix page navigation in useApiIndex

This commit is contained in:
philipp lang 2024-02-08 22:41:57 +01:00
parent 590696750b
commit 7361dcccff
1 changed files with 7 additions and 1 deletions

View File

@ -16,11 +16,16 @@ export function useApiIndex(url, siteName) {
page: resetPage ? 1 : inner.meta.value.current_page,
};
var response = (await axios.get(url, params)).data;
var response = (await axios.get(url, {params})).data;
inner.data.value = response.data;
inner.meta.value = response.meta;
}
async function reloadPage(page) {
inner.meta.value.current_page = page;
await reload(false);
}
function create() {
single.value = JSON.parse(JSON.stringify(inner.meta.value.default));
}
@ -72,6 +77,7 @@ export function useApiIndex(url, siteName) {
create,
edit,
reload,
reloadPage,
can,
requestCallback,
router,