mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core&ui: move domain_delete to domain_dashboard page
This commit is contained in:
3 files changed
+24
-22
No files matched your search
@@ -99,14 +99,6 @@ class DomainEditHandler extends ManageHandler {
|
||||
await domain.edit(args.domainId, $set);
|
||||
this.response.redirect = this.url('domain_dashboard');
|
||||
}
|
||||
|
||||
@requireSudo
|
||||
async postDelete({ domainId }) {
|
||||
if (domainId === 'system') throw new CannotDeleteSystemDomainError();
|
||||
if (this.domain.owner !== this.user._id) throw new OnlyOwnerCanDeleteDomainError();
|
||||
await domain.del(domainId);
|
||||
this.response.redirect = this.url('home_domain', { domainId: 'system' });
|
||||
}
|
||||
}
|
||||
|
||||
class DomainDashboardHandler extends ManageHandler {
|
||||
@@ -129,6 +121,14 @@ class DomainDashboardHandler extends ManageHandler {
|
||||
}
|
||||
this.back();
|
||||
}
|
||||
|
||||
@requireSudo
|
||||
async postDelete({ domainId }) {
|
||||
if (domainId === 'system') throw new CannotDeleteSystemDomainError();
|
||||
if (this.domain.owner !== this.user._id) throw new OnlyOwnerCanDeleteDomainError();
|
||||
await domain.del(domainId);
|
||||
this.response.redirect = this.url('home_domain', { domainId: 'system' });
|
||||
}
|
||||
}
|
||||
|
||||
class DomainUserHandler extends ManageHandler {
|
||||
|
||||
Reference in new issue
Block a user