Skip to content
Snippets Groups Projects

Ability to install frontends

Merged Angelina Filippova requested to merge feature/install-switch-frontends into develop
Files
27
+ 21
0
import request from '@/utils/request'
import { getToken } from '@/utils/auth'
import { baseName } from './utils'
import _ from 'lodash'
export async function deleteInstanceDocument(name, authHost, token) {
return await request({
@@ -68,4 +69,24 @@ export async function removeSettings(configs, authHost, token) {
})
}
export async function fetchFrontends(authHost, token) {
return await request({
baseURL: baseName(authHost),
url: `/api/pleroma/admin/frontends`,
method: 'get',
headers: authHeaders(token)
})
}
export async function installFrontend(data, authHost, token) {
const filteredData = _.pickBy(data)
return await request({
baseURL: baseName(authHost),
url: `/api/pleroma/admin/frontends/install`,
method: 'post',
headers: authHeaders(token),
data: filteredData
})
}
const authHeaders = (token) => token ? { 'Authorization': `Bearer ${getToken()}` } : {}
Loading