Replace fetch with request

This commit is contained in:
Angelina Filippova 2020-09-17 03:50:43 +03:00
parent 7f59ccb050
commit b1c22da958
2 changed files with 8 additions and 9 deletions

View file

@ -39,14 +39,13 @@ export async function getInstanceDocument(name, authHost, token) {
}
export async function updateInstanceDocument(name, formData, authHost, token) {
const url = baseName(authHost) + `/api/pleroma/admin/instance_document/${name}`
return fetch(url, {
body: formData,
method: 'PATCH',
headers: authHeaders(token)
return await request({
baseURL: baseName(authHost),
url: `/api/pleroma/admin/instance_document/${name}`,
method: 'patch',
data: formData,
headers: { ...authHeaders(token), 'Content-Type': 'multipart/form-data' }
})
.then((data) => data.json())
}
export async function updateSettings(configs, authHost, token) {

View file

@ -166,8 +166,8 @@ export default {
return _.get(this.settings.settings, [':pleroma', ':welcome']) || {}
}
},
mounted() {
this.$store.dispatch('FetchInstanceDocument', 'instance-panel')
async mounted() {
await this.$store.dispatch('FetchInstanceDocument', 'instance-panel')
},
methods: {
handleEditorUpdate(content) {