[mastodon-client] Fix posting statuses with attachment

This commit is contained in:
Laura Hausmann 2023-07-05 20:35:44 +02:00 committed by Laura Hausmann
parent 147e9f1e89
commit 6606abd7d9
1 changed files with 3 additions and 0 deletions

View File

@ -59,6 +59,9 @@ export function apiStatusMastodon(router: Router): void {
}
if (!body.media_ids) body.media_ids = undefined;
if (body.media_ids && !body.media_ids.length) body.media_ids = undefined;
if (body.media_ids) {
body.media_ids = (body.media_ids as string[]).map(p => convertId(p, IdType.CalckeyId));
}
const { sensitive } = body;
body.sensitive =
typeof sensitive === "string" ? sensitive === "true" : sensitive;