forked from AkkomaGang/admin-fe
Replace fetch with request
This commit is contained in:
parent
7f59ccb050
commit
b1c22da958
2 changed files with 8 additions and 9 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue