aboutsummaryrefslogtreecommitdiff
path: root/src/services/api/api.service.js
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-07-07 10:01:37 +0300
committerShpuld Shpuldson <shp@cock.li>2020-07-07 10:01:37 +0300
commite3991db5c45c06a6102ae1576614af5b58af0103 (patch)
treeea563bcbe213be867ae508335817ac6de3671f7a /src/services/api/api.service.js
parentf4bdbf76917ba1eb36586ecd1a37d393f672e931 (diff)
parent9ccc6174a73199dc3c5fabfc9a9769ab9265060a (diff)
fix conflicts and add error handling to media descriptions
Diffstat (limited to 'src/services/api/api.service.js')
-rw-r--r--src/services/api/api.service.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 067acbe9..ad543c6c 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -645,7 +645,8 @@ const postStatus = ({
poll,
mediaIds = [],
inReplyToStatusId,
- contentType
+ contentType,
+ preview
}) => {
const form = new FormData()
const pollOptions = poll.options || []
@@ -675,6 +676,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,
@@ -682,13 +686,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))
}