Fix search() not honouring type param
This commit is contained in:
parent
b247a91724
commit
b11ac22192
@ -747,8 +747,8 @@ const statuses = {
|
|||||||
rootState.api.backendInteractor.fetchRebloggedByUsers({ id })
|
rootState.api.backendInteractor.fetchRebloggedByUsers({ id })
|
||||||
.then(rebloggedByUsers => commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser }))
|
.then(rebloggedByUsers => commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser }))
|
||||||
},
|
},
|
||||||
search (store, { q, resolve, limit, offset, following }) {
|
search (store, { q, resolve, limit, offset, following, type }) {
|
||||||
return store.rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following })
|
return store.rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following, type })
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
store.commit('addNewUsers', data.accounts)
|
store.commit('addNewUsers', data.accounts)
|
||||||
store.commit('addNewStatuses', { statuses: data.statuses })
|
store.commit('addNewStatuses', { statuses: data.statuses })
|
||||||
|
@ -1002,7 +1002,7 @@ const searchUsers = ({ credentials, query }) => {
|
|||||||
.then((data) => data.map(parseUser))
|
.then((data) => data.map(parseUser))
|
||||||
}
|
}
|
||||||
|
|
||||||
const search2 = ({ credentials, q, resolve, limit, offset, following }) => {
|
const search2 = ({ credentials, q, resolve, limit, offset, following, type }) => {
|
||||||
let url = MASTODON_SEARCH_2
|
let url = MASTODON_SEARCH_2
|
||||||
let params = []
|
let params = []
|
||||||
|
|
||||||
@ -1026,6 +1026,10 @@ const search2 = ({ credentials, q, resolve, limit, offset, following }) => {
|
|||||||
params.push(['following', true])
|
params.push(['following', true])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type) {
|
||||||
|
params.push(['following', type])
|
||||||
|
}
|
||||||
|
|
||||||
params.push(['with_relationships', true])
|
params.push(['with_relationships', true])
|
||||||
|
|
||||||
let queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')
|
let queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')
|
||||||
|
Loading…
Reference in New Issue
Block a user