Add media attachment functionality to posts

This commit is contained in:
Jesse Wierzbinski 2023-11-22 13:40:31 -10:00
parent c66e1ac146
commit 28a16e95a4
No known key found for this signature in database
5 changed files with 211 additions and 44 deletions

View file

@ -351,6 +351,7 @@ export const createNewStatus = async (data: {
content_type?: string;
uri?: string;
mentions?: User[];
media_attachments?: string[];
reply?: {
status: Status;
user: User;
@ -397,6 +398,15 @@ export const createNewStatus = async (data: {
};
}),
},
attachments: data.media_attachments
? {
connect: data.media_attachments.map(attachment => {
return {
id: attachment,
};
}),
}
: undefined,
inReplyToPostId: data.reply?.status.id,
quotingPostId: data.quote?.id,
instanceId: data.account.instanceId || undefined,