refactor(AdminService, EditUserView): streamline character data deletion and enhance confirmation dialog
All checks were successful
Deploy to production / deploy (push) Successful in 1m46s
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user