mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
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:
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user