aboutsummaryrefslogtreecommitdiff
path: root/src/site/store
diff options
context:
space:
mode:
authorZephyrrus <[email protected]>2021-01-08 17:44:48 +0200
committerZephyrrus <[email protected]>2021-01-08 17:44:48 +0200
commite962efd01486020d04c1774c2691e8d8799ac845 (patch)
tree61bee0d49e464ca27aabbdef90392a1ff56c85e9 /src/site/store
parentchore: remove query from API response (diff)
downloadhost.fuwn.me-e962efd01486020d04c1774c2691e8d8799ac845.tar.xz
host.fuwn.me-e962efd01486020d04c1774c2691e8d8799ac845.zip
fix: pagination not working when searching
fix: search not working on albums
Diffstat (limited to 'src/site/store')
-rw-r--r--src/site/store/images.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/site/store/images.js b/src/site/store/images.js
index 535e7cd..0932aca 100644
--- a/src/site/store/images.js
+++ b/src/site/store/images.js
@@ -109,15 +109,13 @@ export const actions = {
return response;
},
- async search({ commit, dispatch }, { q, albumId, page }) {
- const optionalAlbum = albumId ? `&albumId=${albumId}` : '';
-
+ async search({ commit, dispatch, state }, { q, albumId, page }) {
page = page || 1;
try {
- const response = await this.$axios.$get(`search/?q=${encodeURI(q)}${optionalAlbum}`);
+ const response = await this.$axios.$get('search', { params: { q: encodeURI(q), limit: state.pagination.limit, page, albumId } });
- commit('setFilesAndMeta', { ...response, page });
+ commit('setFilesAndMeta', { ...response, page, name: state.albumName });
return response;
} catch (e) {