[mastodon-client] Fix /v1/accounts/relationships for clients that don't use the id[] parameter

This commit is contained in:
Laura Hausmann 2023-11-30 16:40:30 +01:00
parent cb8b736592
commit 2e8598acb5
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605

View File

@ -31,7 +31,9 @@ export function setupEndpointsAccount(router: Router): void {
router.get("/v1/accounts/relationships", router.get("/v1/accounts/relationships",
auth(true, ['read:follows']), auth(true, ['read:follows']),
async (ctx) => { async (ctx) => {
const ids = (normalizeUrlQuery(ctx.query, ['id[]'])['id[]'] ?? []); const ids = normalizeUrlQuery(ctx.query, ['id[]'])['id[]']
?? normalizeUrlQuery(ctx.query, ['id'])['id']
?? [];
ctx.body = await UserHelpers.getUserRelationhipToMany(ids, ctx.user.id); ctx.body = await UserHelpers.getUserRelationhipToMany(ids, ctx.user.id);
} }
); );