diff --git a/app/assets/javascripts/admin/addon/components/admin-flags.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/flags.gjs similarity index 63% rename from app/assets/javascripts/admin/addon/components/admin-flags.gjs rename to app/assets/javascripts/admin/addon/components/admin-config-areas/flags.gjs index b6f5c130d93..3be32a52704 100644 --- a/app/assets/javascripts/admin/addon/components/admin-flags.gjs +++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/flags.gjs @@ -6,9 +6,10 @@ import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import i18n from "discourse-common/helpers/i18n"; import { bind } from "discourse-common/utils/decorators"; +import AdminConfigHeader from "admin/components/admin-config-header"; import AdminFlagItem from "admin/components/admin-flag-item"; -export default class AdminFlags extends Component { +export default class AdminConfigAreasFlags extends Component { @service site; @tracked flags = this.site.flagTypes; @@ -46,19 +47,39 @@ export default class AdminFlags extends Component { }); } + @action + deleteFlagCallback(flag) { + return ajax(`/admin/config/flags/${flag.id}`, { + type: "DELETE", + }) + .then(() => { + this.flags.removeObject(flag); + }) + .catch((error) => popupAjaxError(error)); + } +