refactor(AdminService, EditUserView): streamline character data deletion and enhance confirmation dialog
All checks were successful
Deploy to production / deploy (push) Successful in 1m46s

- Introduced a reusable `deleteIfTableExists` function in AdminService to simplify the deletion of character-related data across multiple tables, improving code maintainability.
- Updated the deletion logic to check for table existence before executing delete queries, enhancing robustness.
- Enhanced the EditUserView by integrating a `ChooseDialog` for user confirmation before proceeding with character death cleanup, improving user experience and interaction clarity.
This commit is contained in:
Torsten Schulz (local)
2026-04-20 16:16:48 +02:00
parent 267711fca6
commit 7417736daf
2 changed files with 67 additions and 80 deletions

View File

@@ -213,6 +213,7 @@
</div>
</div>
</div>
<ChooseDialog ref="chooseDialog" />
</div>
</template>
@@ -220,13 +221,15 @@
import { mapState } from 'vuex';
import { mapActions } from 'vuex';
import SimpleTabs from '@/components/SimpleTabs.vue';
import ChooseDialog from '@/dialogues/standard/ChooseDialog.vue';
import apiClient from '@/utils/axios.js';
import { showApiError, showError, showSuccess } from '@/utils/feedback.js';
export default {
name: 'AdminFalukantEditUserView',
components: {
SimpleTabs
SimpleTabs,
ChooseDialog
},
data() {
return {
@@ -581,7 +584,11 @@ export default {
if (!characterId) {
return;
}
if (!window.confirm(this.$t('admin.falukant.edituser.deathCleanup.confirm'))) {
const confirmed = await this.$refs.chooseDialog.open({
title: this.$t('common.confirm'),
message: this.$t('admin.falukant.edituser.deathCleanup.confirm')
});
if (!confirmed) {
return;
}
try {