Add mentions field to PostData object

This commit is contained in:
silverpill 2022-01-15 16:41:49 +00:00
parent 1f01f6c60d
commit 4dbb59c587
2 changed files with 5 additions and 1 deletions

View file

@ -117,6 +117,7 @@ export interface PostData {
content: string; content: string;
in_reply_to_id: string | null; in_reply_to_id: string | null;
visibility: string; visibility: string;
mentions: string[];
} }
export async function createPost( export async function createPost(
@ -131,6 +132,7 @@ export async function createPost(
"media_ids[]": attachment ? [attachment.id] : null, "media_ids[]": attachment ? [attachment.id] : null,
in_reply_to_id: postData.in_reply_to_id, in_reply_to_id: postData.in_reply_to_id,
visibility: postData.visibility, visibility: postData.visibility,
mentions: postData.mentions,
} }
const response = await http(url, { const response = await http(url, {
method: "POST", method: "POST",

View file

@ -122,8 +122,9 @@ export default class PostEditor extends Vue {
inReplyTo: Post | null = null inReplyTo: Post | null = null
content = "" content = ""
visibility = "public"
attachment: Attachment | null = null attachment: Attachment | null = null
visibility = "public"
mentions: string[] = []
visibilityMenuVisible = false visibilityMenuVisible = false
errorMessage: string | null = null errorMessage: string | null = null
@ -183,6 +184,7 @@ export default class PostEditor extends Vue {
content, content,
in_reply_to_id: this.inReplyTo ? this.inReplyTo.id : null, in_reply_to_id: this.inReplyTo ? this.inReplyTo.id : null,
visibility: this.visibility, visibility: this.visibility,
mentions: this.mentions,
} }
let post let post
try { try {