mirror of
https://github.com/directus/directus.git
synced 2026-01-23 22:48:25 -05:00
fix ts errors
This commit is contained in:
@@ -124,7 +124,7 @@ export default defineComponent({
|
||||
const values = {
|
||||
...item.value,
|
||||
...edits.value,
|
||||
};
|
||||
} as Record<string, any>;
|
||||
|
||||
return !!values.admin_access;
|
||||
});
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user