mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-28 23:08:12 +09:00
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
This commit is contained in:
parent
0b826cf267
commit
14e59f2401
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user