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:
2026-02-22 21:21:05 +02:00
parent 34769a84eb
commit a993f8944d
2 changed files with 48 additions and 148 deletions
@@ -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