update domains api routes

This commit is contained in:
axolotle 2021-03-22 13:50:04 +01:00
parent 09b8fadc70
commit 4592a7d79d
2 changed files with 4 additions and 7 deletions

View file

@ -84,7 +84,7 @@ export default {
data () {
return {
queries: [
['GET', `domains/cert-status/${this.name}?full`]
['GET', `domains/${this.name}/cert?full`]
],
cert: undefined,
actionsEnabled: undefined
@ -147,13 +147,11 @@ export default {
const confirmed = await this.$askConfirmation(this.$i18n.t(`confirm_cert_${action}`))
if (!confirmed) return
let uri = 'domains/cert-install/' + this.name
let uri = `domains/${this.name}/cert`
if (action === 'regen_selfsigned') uri += '?self_signed'
else if (action === 'manual_renew_LE') uri += '?force'
else if (action === 'revert_to_selfsigned') uri += '?self_signed&force'
// FIXME trigger loading ? while posting ? while getting ?
// this.$refs.view.fallback_loading = true
api.post(uri).then(this.$refs.view.fetchQueries)
api.put(uri).then(this.$refs.view.fetchQueries)
}
}
}

View file

@ -94,8 +94,7 @@ export default {
if (!confirmed) return
api.put(
{ uri: 'domains/main', storeKey: 'main_domain' },
{ new_main_domain: this.name }
{ uri: `domains/${this.name}/main`, storeKey: 'main_domain' }
).then(() => {
// 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)