[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
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -31,7 +31,9 @@ export function setupEndpointsAccount(router: Router): void {
router.get("/v1/accounts/relationships",
auth(true, ['read:follows']),
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);
}
);