diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-10-30 12:53:28 +0100 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-10-30 12:53:28 +0100 |
| commit | 46bb5f2dac16a54bcaedafaed397c8cdc02d7008 (patch) | |
| tree | 2036015ea21c0b5dbed9f0270aa260d599c2a105 /packages/megalodon | |
| parent | chore: lint (diff) | |
| download | sharkey-46bb5f2dac16a54bcaedafaed397c8cdc02d7008.tar.gz sharkey-46bb5f2dac16a54bcaedafaed397c8cdc02d7008.tar.bz2 sharkey-46bb5f2dac16a54bcaedafaed397c8cdc02d7008.zip | |
fix: lists not being received properly
Diffstat (limited to 'packages/megalodon')
| -rw-r--r-- | packages/megalodon/src/misskey.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index a0b222c230..7d68d4eddf 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -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)) })) } |