fix: prevent deletion of owner
This commit is contained in:
parent
97331c9b73
commit
e330e3a7d6
1 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,11 @@
|
|||
>
|
||||
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||
</RouterLink>
|
||||
<div v-if="can('delete', 'user', 'user')" @click="openDeleteModal">
|
||||
<div
|
||||
v-if="can('delete', 'user', 'user')"
|
||||
:class="user.isOwner ? 'opacity-75 pointer-events-none' : ''"
|
||||
@click="openDeleteModal"
|
||||
>
|
||||
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -70,6 +74,7 @@ export default defineComponent({
|
|||
methods: {
|
||||
...mapActions(useModalStore, ["openModal"]),
|
||||
openDeleteModal() {
|
||||
if (this.user.isOwner) return;
|
||||
this.openModal(
|
||||
markRaw(defineAsyncComponent(() => import("@/components/admin/user/user/DeleteUserModal.vue"))),
|
||||
this.user.id
|
||||
|
|
Loading…
Reference in a new issue