diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-09-29 08:18:02 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2020-09-29 08:18:02 +0000 |
| commit | 3781e521e64a59c4e38902601555ae01f99d9fce (patch) | |
| tree | 6cadf6ff7396eacfb7c3972834990a94f927546b /src/services/api | |
| parent | 787f52e06e1bf90bd8e103afad39d2fbd81c38f8 (diff) | |
| parent | 5942001626d01f6438e53943f1b8a8a2448d1378 (diff) | |
Merge branch 'feature/import_export_mutes' into 'develop'
[#2099] Added import/export mutes [FE]
See merge request pleroma/pleroma-fe!1229
Diffstat (limited to 'src/services/api')
| -rw-r--r-- | src/services/api/api.service.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index da519001..34f86f93 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -3,6 +3,7 @@ import { parseStatus, parseUser, parseNotification, parseAttachment, parseChat, import { RegistrationError, StatusCodeError } from '../errors/errors' /* eslint-env browser */ +const MUTES_IMPORT_URL = '/api/pleroma/mutes_import' const BLOCKS_IMPORT_URL = '/api/pleroma/blocks_import' const FOLLOW_IMPORT_URL = '/api/pleroma/follow_import' const DELETE_ACCOUNT_URL = '/api/pleroma/delete_account' @@ -710,6 +711,17 @@ const setMediaDescription = ({ id, description, credentials }) => { }).then((data) => parseAttachment(data)) } +const importMutes = ({ file, credentials }) => { + const formData = new FormData() + formData.append('list', file) + return fetch(MUTES_IMPORT_URL, { + body: formData, + method: 'POST', + headers: authHeaders(credentials) + }) + .then((response) => response.ok) +} + const importBlocks = ({ file, credentials }) => { const formData = new FormData() formData.append('list', file) @@ -1280,6 +1292,7 @@ const apiService = { getCaptcha, updateProfileImages, updateProfile, + importMutes, importBlocks, importFollows, deleteAccount, |
