forked from AkkomaGang/akkoma-fe
move formData generating logic to api.service
This commit is contained in:
parent
562120ae48
commit
903bce40c3
3 changed files with 6 additions and 7 deletions
|
@ -13,10 +13,7 @@ const Importer = {
|
||||||
},
|
},
|
||||||
submit () {
|
submit () {
|
||||||
this.uploading = true
|
this.uploading = true
|
||||||
// eslint-disable-next-line no-undef
|
this.$store.state.api.backendInteractor.followImport(this.file)
|
||||||
const formData = new FormData()
|
|
||||||
formData.append('list', this.file)
|
|
||||||
this.$store.state.api.backendInteractor.followImport({params: formData})
|
|
||||||
.then((status) => {
|
.then((status) => {
|
||||||
if (status) {
|
if (status) {
|
||||||
this.success = true
|
this.success = true
|
||||||
|
|
|
@ -634,9 +634,11 @@ const uploadMedia = ({formData, credentials}) => {
|
||||||
.then((data) => parseAttachment(data))
|
.then((data) => parseAttachment(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
const followImport = ({params, credentials}) => {
|
const followImport = ({file, credentials}) => {
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('list', file)
|
||||||
return fetch(FOLLOW_IMPORT_URL, {
|
return fetch(FOLLOW_IMPORT_URL, {
|
||||||
body: params,
|
body: formData,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: authHeaders(credentials)
|
headers: authHeaders(credentials)
|
||||||
})
|
})
|
||||||
|
|
|
@ -107,7 +107,7 @@ const backendInteractorService = (credentials) => {
|
||||||
const updateProfile = ({params}) => apiService.updateProfile({credentials, params})
|
const updateProfile = ({params}) => apiService.updateProfile({credentials, params})
|
||||||
|
|
||||||
const externalProfile = (profileUrl) => apiService.externalProfile({profileUrl, credentials})
|
const externalProfile = (profileUrl) => apiService.externalProfile({profileUrl, credentials})
|
||||||
const followImport = ({params}) => apiService.followImport({params, credentials})
|
const followImport = (file) => apiService.followImport({file, credentials})
|
||||||
|
|
||||||
const deleteAccount = ({password}) => apiService.deleteAccount({credentials, password})
|
const deleteAccount = ({password}) => apiService.deleteAccount({credentials, password})
|
||||||
const changePassword = ({password, newPassword, newPasswordConfirmation}) => apiService.changePassword({credentials, password, newPassword, newPasswordConfirmation})
|
const changePassword = ({password, newPassword, newPasswordConfirmation}) => apiService.changePassword({credentials, password, newPassword, newPasswordConfirmation})
|
||||||
|
|
Loading…
Reference in a new issue