From f8178a9535e2cea50a85a39c2bc5a8ea0a126214 Mon Sep 17 00:00:00 2001 From: fruye Date: Thu, 27 Apr 2023 22:31:23 +0200 Subject: [PATCH] fix: Get list titles from Form data when creating and updating lists This change will actually make it possible for Mastodon clients to create and rename lists, as they send the title in a Form data instead of a query string. https://docs.joinmastodon.org/methods/lists/#form-data-parameters --- .../backend/src/server/api/mastodon/endpoints/timeline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts index ce3a4dc958..57e5d9bb02 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts @@ -211,7 +211,7 @@ export function apiTimelineMastodon(router: Router): void { const accessTokens = ctx.headers.authorization; const client = getClient(BASE_URL, accessTokens); try { - const data = await client.createList((ctx.query as any).title); + const data = await client.createList((ctx.request.body as any).title); ctx.body = data.data; } catch (e: any) { console.error(e); @@ -227,7 +227,7 @@ export function apiTimelineMastodon(router: Router): void { const accessTokens = ctx.headers.authorization; const client = getClient(BASE_URL, accessTokens); try { - const data = await client.updateList(ctx.params.id, ctx.query as any); + const data = await client.updateList(ctx.params.id, (ctx.request.body as any).title); ctx.body = data.data; } catch (e: any) { console.error(e);