fix: lists not being received properly

This commit is contained in:
Mar0xy 2023-10-30 12:53:28 +01:00
parent e24a57402b
commit 46bb5f2dac
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
2 changed files with 9 additions and 4 deletions

View file

@ -1892,9 +1892,15 @@ export default class Misskey implements MegalodonInterface {
/**
* POST /api/users/lists/list
*/
public async getLists(id: string): Promise<Response<Array<Entity.List>>> {
public async getLists(id?: string): Promise<Response<Array<Entity.List>>> {
if (id) {
return this.client
.post<Array<MisskeyAPI.Entity.List>>('/api/users/lists/list', { userId: id })
.then(res => ({ ...res, data: res.data.map(l => MisskeyAPI.Converter.list(l)) }))
}
return this.client
.post<Array<MisskeyAPI.Entity.List>>('/api/users/lists/list', { userId: id })
.post<Array<MisskeyAPI.Entity.List>>('/api/users/lists/list', {})
.then(res => ({ ...res, data: res.data.map(l => MisskeyAPI.Converter.list(l)) }))
}