Account for revisions data/delta to be null (#21596)

This commit is contained in:
Pascal Jufer
2024-02-27 10:23:16 +01:00
committed by GitHub
parent 256faa68ad
commit f2917b49af
2 changed files with 3 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
export type Revision = {
id: number;
data: Record<string, any>;
delta: Record<string, any>;
data: Record<string, any> | null;
delta: Record<string, any> | null;
collection: string;
item: string | number;
activity: {

View File

@@ -16,9 +16,7 @@ defineEmits<{
const { t } = useI18n();
const revisionCount = computed(() => {
return Object.keys(props.revision.delta).length;
});
const revisionCount = computed(() => (props.revision.delta ? Object.keys(props.revision.delta).length : 0));
const headerMessage = computed(() => {
switch (props.revision.activity.action.toLowerCase()) {