From 8a4b4db6fce2c975952d90e1d67e72f0ab2ccac3 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 30 Sep 2024 13:43:08 +0930 Subject: [PATCH] fix(function): Ensure for field data that relationship and serializer dont attempt to fetch object items when not an object ref: #1 nofusscomputing/centurion_erp#248 nofusscomputing/centurion_erp#307 nofusscomputing/centurion_erp#319 --- src/functions/FieldData.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/functions/FieldData.js b/src/functions/FieldData.js index 1b325c4..32bf0e4 100644 --- a/src/functions/FieldData.js +++ b/src/functions/FieldData.js @@ -90,8 +90,8 @@ export default function FieldData({ field_data = '-' - } else { - + } else if( typeof(data[field_name]) === 'object' ){ + if( 'url' in data[field_name] ) { field_data = ( @@ -104,6 +104,10 @@ export default function FieldData({ } + } else { + + field_data = data[field_name] + } break;