diff options
| author | Kana <[email protected]> | 2021-01-09 00:53:16 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-09 00:53:16 +0900 |
| commit | 01e17ed856c4bf095ca53e899e21c192dad01318 (patch) | |
| tree | 65dffc52d24192ffb2a0b4585bda2e7bc235b73c /src/site/store | |
| parent | feat: use LIKE on queries for case sensitivity issues (diff) | |
| parent | fix: pagination not working when searching (diff) | |
| download | host.fuwn.me-01e17ed856c4bf095ca53e899e21c192dad01318.tar.xz host.fuwn.me-01e17ed856c4bf095ca53e899e21c192dad01318.zip | |
Merge pull request #251 from Zephyrrus/fix/paginate_search
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.js | 8 |
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) { |