add “block import” feature
This commit is contained in:
parent
6ea4154084
commit
0ab2f9dfa5
5 changed files with 32 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue