fix: lists not being received properly
This commit is contained in:
parent
e24a57402b
commit
46bb5f2dac
2 changed files with 9 additions and 4 deletions
|
@ -151,8 +151,7 @@ export class ApiTimelineMastodon {
|
|||
const BASE_URL = `${_request.protocol}://${_request.hostname}`;
|
||||
const accessTokens = _request.headers.authorization;
|
||||
const client = getClient(BASE_URL, accessTokens);
|
||||
const account = await client.verifyAccountCredentials();
|
||||
const data = await client.getLists(account.data.id);
|
||||
const data = await client.getLists();
|
||||
reply.send(data.data.map((list: Entity.List) => convertList(list)));
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
|
|
|
@ -1892,12 +1892,18 @@ 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', {})
|
||||
.then(res => ({ ...res, data: res.data.map(l => MisskeyAPI.Converter.list(l)) }))
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /api/users/lists/show
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue