diff --git a/src/components/Paginator.vue b/src/components/Paginator.vue new file mode 100644 index 0000000..31d14ca --- /dev/null +++ b/src/components/Paginator.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/src/store/search.js b/src/store/search.js index b383fef..113c6da 100644 --- a/src/store/search.js +++ b/src/store/search.js @@ -12,8 +12,10 @@ export default { profiles: [], error: false, errorMessage: '', + pages: 1, query: { - search: '' + search: '', + page: 1 } } }, @@ -41,6 +43,12 @@ export default { }, setQuerySearch(state, search) { state.query.search = search + }, + setPages(state, pages) { + state.pages = pages + }, + setQueryPage(state, page) { + state.query.page = page } }, actions: { @@ -65,6 +73,8 @@ export default { url.searchParams.append('search', state.query.search) } + url.searchParams.append('page', state.query.page) + const headers = { Authorization: `Bearer ${rootState.token}`, } @@ -93,6 +103,7 @@ export default { const responseData = await response.json() commit('setProfiles', responseData.profiles) + commit('setPages', responseData.pages) commit('setSearching', false) commit('hideSpinner') } diff --git a/src/views/Search.vue b/src/views/Search.vue index ae36c63..2151855 100644 --- a/src/views/Search.vue +++ b/src/views/Search.vue @@ -53,12 +53,26 @@ SPDX-License-Identifier: AGPL-3.0-or-later

Probiere eine andere Suche.

+
+ +
+
+ +
@@ -67,21 +81,29 @@ SPDX-License-Identifier: AGPL-3.0-or-later