fix: handle correct type conversion for relation fields

Updated `RelationField` to dynamically determine the type based on `target_field_type`. Added a test for proper TypeScript generation with text primary fields in system entities.
This commit is contained in:
dswbx
2025-09-30 13:32:22 +02:00
parent 0f54e8267f
commit 610e263477
2 changed files with 32 additions and 1 deletions

View File

@@ -84,9 +84,10 @@ export class RelationField extends Field<RelationFieldConfig> {
}
override toType(): TFieldTSType {
const type = this.config.target_field_type === "integer" ? "number" : "string";
return {
...super.toType(),
type: "number",
type,
};
}
}