forked from AkkomaGang/admin-fe
Add api functions for modifying instance docs
This commit is contained in:
parent
413e0f5b7f
commit
b039968517
1 changed files with 29 additions and 0 deletions
|
@ -2,6 +2,15 @@ import request from '@/utils/request'
|
|||
import { getToken } from '@/utils/auth'
|
||||
import { baseName } from './utils'
|
||||
|
||||
export async function deleteInstanceDocument(name, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/instance_document/${name}`,
|
||||
method: 'delete',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
}
|
||||
|
||||
export async function fetchDescription(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
|
@ -20,6 +29,26 @@ export async function fetchSettings(authHost, token) {
|
|||
})
|
||||
}
|
||||
|
||||
export async function getInstanceDocument(name, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/instance_document/${name}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(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)
|
||||
})
|
||||
.then((data) => data.json())
|
||||
}
|
||||
|
||||
export async function updateSettings(configs, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
|
|
Loading…
Reference in a new issue