summaryrefslogtreecommitdiff
path: root/packages/megalodon
diff options
context:
space:
mode:
authorMar0xy <marie@kaifa.ch>2023-10-30 12:53:28 +0100
committerMar0xy <marie@kaifa.ch>2023-10-30 12:53:28 +0100
commit46bb5f2dac16a54bcaedafaed397c8cdc02d7008 (patch)
tree2036015ea21c0b5dbed9f0270aa260d599c2a105 /packages/megalodon
parentchore: lint (diff)
downloadsharkey-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.ts10
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)) }))
}