From a480e1be557dea09d40c107292f881bd30a48e8b Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Mon, 13 Feb 2023 16:53:56 +0100 Subject: [PATCH] add debug to error --- packages/backend/src/server/api/mastodon/endpoints/account.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 5c1a2820fc..2d66e93747 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -299,9 +299,11 @@ export function apiAccountMastodon(router: Router): void { const BASE_URL = `${ctx.protocol}://${ctx.hostname}`; const accessTokens = ctx.headers.authorization; const client = getClient(BASE_URL, accessTokens); + let users; try { const idsRaw = (ctx.query as any)["id[]"]; const ids = typeof idsRaw === "string" ? [idsRaw] : idsRaw; + users = ids; relationshopModel.id = idsRaw || "1"; if (!idsRaw) return [relationshopModel]; const data = (await client.getRelationships(ids)) as any; @@ -310,7 +312,7 @@ export function apiAccountMastodon(router: Router): void { console.error(e); console.error(e.response.data); ctx.status = 401; - ctx.body = e.response.data; + ctx.body = { ...e.response.data, ...{user: users} }; } }); router.get("/v1/bookmarks", async (ctx) => {