From 4dbb59c587d01d36ced63c4570e5ecd723d2f360 Mon Sep 17 00:00:00 2001 From: silverpill Date: Sat, 15 Jan 2022 16:41:49 +0000 Subject: [PATCH] Add mentions field to PostData object --- src/api/posts.ts | 2 ++ src/components/PostEditor.vue | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/posts.ts b/src/api/posts.ts index bc4766c..02bdf2d 100644 --- a/src/api/posts.ts +++ b/src/api/posts.ts @@ -117,6 +117,7 @@ export interface PostData { content: string; in_reply_to_id: string | null; visibility: string; + mentions: string[]; } export async function createPost( @@ -131,6 +132,7 @@ export async function createPost( "media_ids[]": attachment ? [attachment.id] : null, in_reply_to_id: postData.in_reply_to_id, visibility: postData.visibility, + mentions: postData.mentions, } const response = await http(url, { method: "POST", diff --git a/src/components/PostEditor.vue b/src/components/PostEditor.vue index ca6c143..279794f 100644 --- a/src/components/PostEditor.vue +++ b/src/components/PostEditor.vue @@ -122,8 +122,9 @@ export default class PostEditor extends Vue { inReplyTo: Post | null = null content = "" - visibility = "public" attachment: Attachment | null = null + visibility = "public" + mentions: string[] = [] visibilityMenuVisible = false errorMessage: string | null = null @@ -183,6 +184,7 @@ export default class PostEditor extends Vue { content, in_reply_to_id: this.inReplyTo ? this.inReplyTo.id : null, visibility: this.visibility, + mentions: this.mentions, } let post try {