diff options
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/api/api.service.js | 13 | ||||
| -rw-r--r-- | src/services/backend_interactor_service/backend_interactor_service.js | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index dbcde41d..a6892959 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -9,6 +9,7 @@ const BANNER_UPDATE_URL = '/api/account/update_profile_banner.json' const PROFILE_UPDATE_URL = '/api/account/update_profile.json' const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json' const QVITTER_USER_NOTIFICATIONS_READ_URL = '/api/qvitter/statuses/notifications/read.json' +const BLOCKS_IMPORT_URL = '/api/pleroma/blocks_import' const FOLLOW_IMPORT_URL = '/api/pleroma/follow_import' const DELETE_ACCOUNT_URL = '/api/pleroma/delete_account' const CHANGE_PASSWORD_URL = '/api/pleroma/change_password' @@ -634,6 +635,17 @@ const uploadMedia = ({formData, credentials}) => { .then((data) => parseAttachment(data)) } +const importBlocks = ({file, credentials}) => { + const formData = new FormData() + formData.append('list', file) + return fetch(BLOCKS_IMPORT_URL, { + body: formData, + method: 'POST', + headers: authHeaders(credentials) + }) + .then((response) => response.ok) +} + const importFollows = ({file, credentials}) => { const formData = new FormData() formData.append('list', file) @@ -778,6 +790,7 @@ const apiService = { updateProfile, updateBanner, externalProfile, + importBlocks, importFollows, deleteAccount, changePassword, diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js index 726c8ced..3256a921 100644 --- a/src/services/backend_interactor_service/backend_interactor_service.js +++ b/src/services/backend_interactor_service/backend_interactor_service.js @@ -107,6 +107,7 @@ const backendInteractorService = (credentials) => { const updateProfile = ({params}) => apiService.updateProfile({credentials, params}) const externalProfile = (profileUrl) => apiService.externalProfile({profileUrl, credentials}) + const importBlocks = (file) => apiService.importBlocks({file, credentials}) const importFollows = (file) => apiService.importFollows({file, credentials}) const deleteAccount = ({password}) => apiService.deleteAccount({credentials, password}) @@ -147,6 +148,7 @@ const backendInteractorService = (credentials) => { updateBanner, updateProfile, externalProfile, + importBlocks, importFollows, deleteAccount, changePassword, |
