Skip to content

Commit 5f65a78

Browse files
committed
Fix issue with nested properties
1 parent d43dc69 commit 5f65a78

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

resources/js/admin/logs/components/Logs/BaseTable/BaseTable.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ export default {
4444
},
4545
methods: {
4646
getItemValue(item, column) {
47-
// if key is a dot-separated string, get the nested value from the item
48-
if (column.key.includes('.')) {
49-
return column.key.split('.').reduce((val, part) => (val != null ? val[part] : undefined), item);
50-
}
47+
// Get value - handle dot-separated keys for nested properties
48+
const value = column.key.includes(".")
49+
? column.key.split(".").reduce((val, part) => (val == null ? undefined : val[part]), item)
50+
: item[column.key];
5151
52-
if (typeof column.format === 'function') {
53-
return column.format(item[column.key]);
52+
// Apply format function if provided
53+
if (typeof column.format === "function") {
54+
return column.format(value);
5455
}
5556
56-
return item[column.key];
57+
return value;
5758
},
5859
},
5960
};
6061
</script>
61-

0 commit comments

Comments
 (0)