aboutsummaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/services')
-rw-r--r--src/services/api/api.service.js13
-rw-r--r--src/services/backend_interactor_service/backend_interactor_service.js2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 13d31d91..3d2e8823 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -18,6 +18,7 @@ const MENTIONS_URL = '/api/statuses/mentions.json'
const DM_TIMELINE_URL = '/api/statuses/dm_timeline.json'
const FOLLOWERS_URL = '/api/statuses/followers.json'
const FRIENDS_URL = '/api/statuses/friends.json'
+const BLOCKS_URL = '/api/statuses/blocks.json'
const FOLLOWING_URL = '/api/friendships/create.json'
const UNFOLLOWING_URL = '/api/friendships/destroy.json'
const QVITTER_USER_PREF_URL = '/api/qvitter/set_profile_pref.json'
@@ -519,6 +520,17 @@ const fetchMutes = ({credentials}) => {
}).then((data) => data.json())
}
+const fetchBlocks = ({page, credentials}) => {
+ return fetch(BLOCKS_URL, {
+ headers: authHeaders(credentials)
+ }).then((data) => {
+ if (data.ok) {
+ return data.json()
+ }
+ throw new Error('Error fetching blocks', data)
+ })
+}
+
const suggestions = ({credentials}) => {
return fetch(SUGGESTIONS_URL, {
headers: authHeaders(credentials)
@@ -560,6 +572,7 @@ const apiService = {
fetchAllFollowing,
setUserMute,
fetchMutes,
+ fetchBlocks,
register,
getCaptcha,
updateAvatar,
diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js
index 80c5cc5e..43c914d9 100644
--- a/src/services/backend_interactor_service/backend_interactor_service.js
+++ b/src/services/backend_interactor_service/backend_interactor_service.js
@@ -63,6 +63,7 @@ const backendInteractorService = (credentials) => {
}
const fetchMutes = () => apiService.fetchMutes({credentials})
+ const fetchBlocks = (params) => apiService.fetchBlocks({credentials, ...params})
const fetchFollowRequests = () => apiService.fetchFollowRequests({credentials})
const getCaptcha = () => apiService.getCaptcha()
@@ -94,6 +95,7 @@ const backendInteractorService = (credentials) => {
startFetching,
setUserMute,
fetchMutes,
+ fetchBlocks,
register,
getCaptcha,
updateAvatar,