mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
update domains api routes
This commit is contained in:
parent
09b8fadc70
commit
4592a7d79d
2 changed files with 4 additions and 7 deletions
|
@ -84,7 +84,7 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
queries: [
|
queries: [
|
||||||
['GET', `domains/cert-status/${this.name}?full`]
|
['GET', `domains/${this.name}/cert?full`]
|
||||||
],
|
],
|
||||||
cert: undefined,
|
cert: undefined,
|
||||||
actionsEnabled: undefined
|
actionsEnabled: undefined
|
||||||
|
@ -147,13 +147,11 @@ export default {
|
||||||
const confirmed = await this.$askConfirmation(this.$i18n.t(`confirm_cert_${action}`))
|
const confirmed = await this.$askConfirmation(this.$i18n.t(`confirm_cert_${action}`))
|
||||||
if (!confirmed) return
|
if (!confirmed) return
|
||||||
|
|
||||||
let uri = 'domains/cert-install/' + this.name
|
let uri = `domains/${this.name}/cert`
|
||||||
if (action === 'regen_selfsigned') uri += '?self_signed'
|
if (action === 'regen_selfsigned') uri += '?self_signed'
|
||||||
else if (action === 'manual_renew_LE') uri += '?force'
|
else if (action === 'manual_renew_LE') uri += '?force'
|
||||||
else if (action === 'revert_to_selfsigned') uri += '?self_signed&force'
|
else if (action === 'revert_to_selfsigned') uri += '?self_signed&force'
|
||||||
// FIXME trigger loading ? while posting ? while getting ?
|
api.put(uri).then(this.$refs.view.fetchQueries)
|
||||||
// this.$refs.view.fallback_loading = true
|
|
||||||
api.post(uri).then(this.$refs.view.fetchQueries)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,8 +94,7 @@ export default {
|
||||||
if (!confirmed) return
|
if (!confirmed) return
|
||||||
|
|
||||||
api.put(
|
api.put(
|
||||||
{ uri: 'domains/main', storeKey: 'main_domain' },
|
{ uri: `domains/${this.name}/main`, storeKey: 'main_domain' }
|
||||||
{ new_main_domain: this.name }
|
|
||||||
).then(() => {
|
).then(() => {
|
||||||
// FIXME Have to commit by hand here since the response is empty (should return the given name)
|
// FIXME Have to commit by hand here since the response is empty (should return the given name)
|
||||||
this.$store.commit('UPDATE_MAIN_DOMAIN', this.name)
|
this.$store.commit('UPDATE_MAIN_DOMAIN', this.name)
|
||||||
|
|
Loading…
Add table
Reference in a new issue