mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Add media attachment functionality to posts
This commit is contained in:
parent
c66e1ac146
commit
28a16e95a4
5 changed files with 211 additions and 44 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue