removed id and _vehicle objects from editor dropdown, json is made procramatically instead of hardcored, so when entity changed, json is auto updated
This commit is contained in:
@@ -91,12 +91,14 @@ export function getAvailableFields(obj, prefix = '') {
|
||||
const fields = [];
|
||||
|
||||
for (const key of Object.keys(obj)) {
|
||||
// Skip raw id/FK fields — only human-readable fields are useful for binding
|
||||
if (key === 'id' || (key.endsWith('_user') && !key.endsWith('_user_name'))) continue;
|
||||
|
||||
const fullPath = prefix ? `${prefix}.${key}` : key;
|
||||
const value = obj[key];
|
||||
|
||||
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
||||
// Nested object - add this key and recurse
|
||||
fields.push(fullPath);
|
||||
// Nested object - recurse into children only (don't add the object itself)
|
||||
fields.push(...getAvailableFields(value, fullPath));
|
||||
} else {
|
||||
// Primitive or array - add this key
|
||||
|
||||
Reference in New Issue
Block a user