Fix search() not honouring type param

This commit is contained in:
Tusooa Zhu 2022-07-15 20:22:39 -04:00
commit b11ac22192
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
2 changed files with 7 additions and 3 deletions

View file

@ -1002,7 +1002,7 @@ const searchUsers = ({ credentials, query }) => {
.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 params = []
@ -1026,6 +1026,10 @@ const search2 = ({ credentials, q, resolve, limit, offset, following }) => {
params.push(['following', true])
}
if (type) {
params.push(['following', type])
}
params.push(['with_relationships', true])
let queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')