mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-23 01:25:12 +00:00
fix: await all results on favourites and reblogged
This commit is contained in:
parent
43f27a639f
commit
90b666e626
2 changed files with 3 additions and 5 deletions
|
@ -98,9 +98,7 @@ export class ApiAccountMastodon {
|
||||||
public async getStatuses() {
|
public async getStatuses() {
|
||||||
try {
|
try {
|
||||||
const data = await this.client.getAccountStatuses((this.request.params as any).id, argsToBools(limitToInt(this.request.query as any)));
|
const data = await this.client.getAccountStatuses((this.request.params as any).id, argsToBools(limitToInt(this.request.query as any)));
|
||||||
const a = await Promise.all(data.data.map(async (status) => await this.mastoconverter.convertStatus(status)));
|
return await Promise.all(data.data.map(async (status) => await this.mastoconverter.convertStatus(status)));
|
||||||
console.error(a);
|
|
||||||
return a;
|
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
console.error(e.response.data);
|
console.error(e.response.data);
|
||||||
|
|
|
@ -89,7 +89,7 @@ export class ApiStatusMastodon {
|
||||||
const client = getClient(BASE_URL, accessTokens);
|
const client = getClient(BASE_URL, accessTokens);
|
||||||
try {
|
try {
|
||||||
const data = await client.getStatusRebloggedBy(_request.params.id);
|
const data = await client.getStatusRebloggedBy(_request.params.id);
|
||||||
reply.send(data.data.map((account: Entity.Account) => this.mastoconverter.convertAccount(account)));
|
reply.send(await Promise.all(data.data.map(async (account: Entity.Account) => await this.mastoconverter.convertAccount(account))));
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
reply.code(401).send(e.response.data);
|
reply.code(401).send(e.response.data);
|
||||||
|
@ -104,7 +104,7 @@ export class ApiStatusMastodon {
|
||||||
const client = getClient(BASE_URL, accessTokens);
|
const client = getClient(BASE_URL, accessTokens);
|
||||||
try {
|
try {
|
||||||
const data = await client.getStatusFavouritedBy(_request.params.id);
|
const data = await client.getStatusFavouritedBy(_request.params.id);
|
||||||
reply.send(data.data.map((account: Entity.Account) => this.mastoconverter.convertAccount(account)));
|
reply.send(await Promise.all(data.data.map(async (account: Entity.Account) => await this.mastoconverter.convertAccount(account))));
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
reply.code(401).send(e.response.data);
|
reply.code(401).send(e.response.data);
|
||||||
|
|
Loading…
Reference in a new issue