[mastodon-client] Fix global timeline
This commit is contained in:
parent
5e6594d91d
commit
7b64cf9688
1 changed files with 8 additions and 7 deletions
|
@ -45,13 +45,14 @@ export function apiTimelineMastodon(router: Router): void {
|
||||||
const client = getClient(BASE_URL, accessTokens);
|
const client = getClient(BASE_URL, accessTokens);
|
||||||
try {
|
try {
|
||||||
const query: any = ctx.query;
|
const query: any = ctx.query;
|
||||||
const data = query.local
|
const data =
|
||||||
? await client.getLocalTimeline(
|
query.local === "true"
|
||||||
convertTimelinesArgsId(argsToBools(limitToInt(query))),
|
? await client.getLocalTimeline(
|
||||||
)
|
convertTimelinesArgsId(argsToBools(limitToInt(query))),
|
||||||
: await client.getPublicTimeline(
|
)
|
||||||
convertTimelinesArgsId(argsToBools(limitToInt(query))),
|
: await client.getPublicTimeline(
|
||||||
);
|
convertTimelinesArgsId(argsToBools(limitToInt(query))),
|
||||||
|
);
|
||||||
ctx.body = data.data.map((status) => convertStatus(status));
|
ctx.body = data.data.map((status) => convertStatus(status));
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
Loading…
Reference in a new issue