Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the missing cursor parameter to unified search requests #22422

Merged
merged 2 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/js/dist/unified-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/unified-search.js.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions core/src/services/UnifiedSearchService.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ export async function getTypes() {
*
* @param {string} type the type to search
* @param {string} query the search
* @param {int|string|undefined} cursor the offset for paginated searches
* @returns {Promise}
*/
export function search(type, query) {
return axios.get(generateUrl(`/search/providers/${type}/search?term=${query}`))
export function search(type, query, cursor) {
return axios.get(generateUrl(`/search/providers/${type}/search?term=${query}`), {
params: {
cursor,
// Sending which location we're currently at
from: window.location.pathname.replace('/index.php', '') + window.location.search,
}
})
}
2 changes: 1 addition & 1 deletion core/src/views/UnifiedSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export default {
this.$set(this.loading, type, true)

if (this.cursors[type]) {
const request = await search(type, this.query)
const request = await search(type, this.query, this.cursors[type])

// Save cursor if any
if (request.data.cursor) {
Expand Down