[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 1f8c735889
commit 37b21f973f

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;