-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
* {
- flex: 1 0 0;
margin: 0 .75em .6em 0;
white-space: nowrap;
}
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 80e94a50..61cd4f16 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -219,13 +219,16 @@ const authHeaders = (accessToken) => {
}
}
-const followUser = ({ id, reblogs, credentials }) => {
+const followUser = ({ id, credentials, ...options }) => {
let url = MASTODON_FOLLOW_URL(id)
- const form = new FormData()
- if (reblogs !== undefined) { form.append('reblogs', reblogs) }
+ const form = {}
+ if (options.reblogs !== undefined) { form['reblogs'] = options.reblogs }
return fetch(url, {
- body: form,
- headers: authHeaders(credentials),
+ body: JSON.stringify(form),
+ headers: {
+ ...authHeaders(credentials),
+ 'Content-Type': 'application/json'
+ },
method: 'POST'
}).then((data) => data.json())
}