fix ts errors

This commit is contained in:
Nitwel
2020-10-21 09:51:34 +02:00
parent 413c8bab64
commit fb755efc4e
4 changed files with 4 additions and 4 deletions

View File

@@ -124,7 +124,7 @@ export default defineComponent({
const values = {
...item.value,
...edits.value,
};
} as Record<string, any>;
return !!values.admin_access;
});

View File

@@ -115,7 +115,7 @@ export default defineComponent({
const title = computed(() => {
if (loading.value) return i18n.t('loading');
if (isNew.value) return i18n.t('creating_webhook');
return item.value.name;
return item.value?.name;
});
return {

View File

@@ -384,7 +384,7 @@ export default defineComponent({
}
async function refreshCurrentUser() {
if (userStore.state.currentUser!.id === item.value.id) {
if (userStore.state.currentUser!.id === item.value?.id) {
await userStore.hydrate();
}
}

View File

@@ -2,7 +2,7 @@ import { usePermissionsStore, useUserStore } from '@/stores';
import { Permission } from '@/types';
import generateJoi from '@/utils/generate-joi';
export function isAllowed(collection: string, action: Permission['action'], value: Record<string, any>) {
export function isAllowed(collection: string, action: Permission['action'], value: Record<string, any> | null) {
const permissionsStore = usePermissionsStore();
const userStore = useUserStore();