mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-14 06:00:44 +01:00
test: try using if statement
This commit is contained in:
parent
77754cc3d8
commit
3b2bf0dc35
1 changed files with 10 additions and 7 deletions
|
@ -628,16 +628,19 @@ export default class Misskey implements MegalodonInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.client.post<Array<MisskeyAPI.Entity.UserDetail>>('/api/users/search', params).then(res => {
|
return this.client.post<Array<MisskeyAPI.Entity.UserDetail>>('/api/users/search', params).then(res => {
|
||||||
|
if ((res.data as any)["error"]) {
|
||||||
|
return Object.assign(res, {
|
||||||
|
data: {
|
||||||
|
accounts: [],
|
||||||
|
statuses: [],
|
||||||
|
hashtags: [],
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
return Object.assign(res, {
|
return Object.assign(res, {
|
||||||
data: res.data.map(u => MisskeyAPI.Converter.userDetail(u, this.baseUrl))
|
data: res.data.map(u => MisskeyAPI.Converter.userDetail(u, this.baseUrl))
|
||||||
})
|
})
|
||||||
}).catch(() => ({
|
})
|
||||||
data: {
|
|
||||||
accounts: [],
|
|
||||||
statuses: [],
|
|
||||||
hashtags: [],
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================
|
// ======================================
|
||||||
|
|
Loading…
Reference in a new issue