diff --git a/src/components/admin/Permission.vue b/src/components/admin/Permission.vue index 359ac18..0f2b50d 100644 --- a/src/components/admin/Permission.vue +++ b/src/components/admin/Permission.vue @@ -106,14 +106,15 @@ export default defineComponent({ default: {}, }, status: { - type: [ - null, - String as PropType<"loading">, - Object as PropType<{ status: "success" | "failed"; message?: string }>, - ], + type: [Object, String, null] as PropType, default: null, }, }, + watch: { + permissions() { + this.permissionUpdate = cloneDeep(this.permissions); + }, + }, emits: ["savePermissions"], data() { return { @@ -141,6 +142,9 @@ export default defineComponent({ const target = e.target as HTMLInputElement; this.isAdmin = target.checked ?? false; this.permissionUpdate.admin = this.isAdmin; + if (!this.isAdmin) { + delete this.permissionUpdate.admin; + } }, togglePermission(type: PermissionType, section: PermissionSection, modul?: PermissionModule) { let permissions = [] as Array | "*"; diff --git a/src/components/admin/settings/communicationType/CreateCommunicationTypeModal.vue b/src/components/admin/settings/communicationType/CreateCommunicationTypeModal.vue index e18f0e9..b6a33a1 100644 --- a/src/components/admin/settings/communicationType/CreateCommunicationTypeModal.vue +++ b/src/components/admin/settings/communicationType/CreateCommunicationTypeModal.vue @@ -82,6 +82,7 @@ import { useCommunicationTypeStore } from "@/stores/admin/communicationType"; import type { CreateCommunicationTypeViewModel } from "@/viewmodels/admin/communicationType.models"; import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue"; import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid"; +import type { CommunicationFieldType } from "@/types/fieldTypes";