Add resolve argument for search account
This commit is contained in:
parent
3f5cb4d025
commit
32e6f16e0e
|
@ -473,12 +473,23 @@ export default class Mastodon implements MegalodonInterface {
|
|||
|
||||
public async searchAccount(
|
||||
q: string,
|
||||
following: boolean,
|
||||
following?: boolean | null,
|
||||
resolve?: boolean | null,
|
||||
limit?: number | null,
|
||||
max_id?: string | null,
|
||||
since_id?: string | null
|
||||
): Promise<Response<Array<Entity.Account>>> {
|
||||
let params = { q: q, following: following }
|
||||
let params = { q: q }
|
||||
if (following !== undefined && following !== null) {
|
||||
params = Object.assign(params, {
|
||||
following: following
|
||||
})
|
||||
}
|
||||
if (resolve !== undefined && resolve !== null) {
|
||||
params = Object.assign(params, {
|
||||
resolve: resolve
|
||||
})
|
||||
}
|
||||
if (max_id) {
|
||||
params = Object.assign(params, {
|
||||
max_id: max_id
|
||||
|
|
|
@ -316,7 +316,8 @@ export interface MegalodonInterface {
|
|||
*/
|
||||
searchAccount(
|
||||
q: string,
|
||||
following: boolean,
|
||||
following?: boolean | null,
|
||||
resolve?: boolean | null,
|
||||
limit?: number | null,
|
||||
max_id?: string | null,
|
||||
since_id?: string | null
|
||||
|
|
|
@ -527,7 +527,8 @@ export default class Misskey implements MegalodonInterface {
|
|||
*/
|
||||
public async searchAccount(
|
||||
q: string,
|
||||
_following: boolean,
|
||||
_following?: boolean | null,
|
||||
resolve?: boolean | null,
|
||||
limit?: number | null,
|
||||
_max_id?: string | null,
|
||||
_since_id?: string | null
|
||||
|
@ -536,6 +537,11 @@ export default class Misskey implements MegalodonInterface {
|
|||
query: q,
|
||||
detail: true
|
||||
}
|
||||
if (resolve !== undefined && resolve !== null) {
|
||||
params = Object.assign(params, {
|
||||
localOnly: resolve
|
||||
})
|
||||
}
|
||||
if (limit) {
|
||||
params = Object.assign(params, {
|
||||
limit: limit
|
||||
|
|
Loading…
Reference in a new issue