From 420e51f8332d59345d437982f3dfe879512d39a4 Mon Sep 17 00:00:00 2001 From: silverpill Date: Fri, 7 Jan 2022 22:12:58 +0000 Subject: [PATCH] Allow to set visibility in post editor --- src/api/posts.ts | 2 ++ src/components/Post.vue | 26 +++++----------- src/components/PostEditor.vue | 51 ++++++++++++++++++++++++++++++- src/components/VisibilityIcon.vue | 11 +++++++ src/styles/_mixins.scss | 17 +++++++++++ 5 files changed, 87 insertions(+), 20 deletions(-) create mode 100644 src/components/VisibilityIcon.vue diff --git a/src/api/posts.ts b/src/api/posts.ts index d62d533..8ab5c6c 100644 --- a/src/api/posts.ts +++ b/src/api/posts.ts @@ -108,6 +108,7 @@ export async function getPostContext( export interface PostData { content: string; in_reply_to_id: string | null; + visibility: string; } export async function createPost( @@ -121,6 +122,7 @@ export async function createPost( status: postData.content, "media_ids[]": attachment ? [attachment.id] : null, in_reply_to_id: postData.in_reply_to_id, + visibility: postData.visibility, } const response = await http(url, { method: "POST", diff --git a/src/components/Post.vue b/src/components/Post.vue index cd49b32..c6c833a 100644 --- a/src/components/Post.vue +++ b/src/components/Post.vue @@ -21,8 +21,7 @@ target="_blank" rel="noreferrer" > - - +
-