diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-06-28 12:16:41 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-06-28 12:16:41 +0300 |
| commit | 223fabfe90512122ee9d51c22deb01241ba931cd (patch) | |
| tree | 2846731fa8947c77c359ba5a187bb22507543341 /src/services/api/api.service.js | |
| parent | 391f796cb491478105a617b6554e9334cca1443b (diff) | |
add rich text preview
Diffstat (limited to 'src/services/api/api.service.js')
| -rw-r--r-- | src/services/api/api.service.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index dfffc291..2f579ed2 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -617,7 +617,8 @@ const postStatus = ({ poll, mediaIds = [], inReplyToStatusId, - contentType + contentType, + preview }) => { const form = new FormData() const pollOptions = poll.options || [] @@ -647,6 +648,9 @@ const postStatus = ({ if (inReplyToStatusId) { form.append('in_reply_to_id', inReplyToStatusId) } + if (preview) { + form.append('preview', 'true') + } return fetch(MASTODON_POST_STATUS_URL, { body: form, @@ -654,13 +658,7 @@ const postStatus = ({ headers: authHeaders(credentials) }) .then((response) => { - if (response.ok) { - return response.json() - } else { - return { - error: response - } - } + return response.json() }) .then((data) => data.error ? data : parseStatus(data)) } |
