1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-03-29 00:50:59 +02:00

ucfirst the DynamicModel field name so that we can use later the same FieldMapper resolver rules

This commit is contained in:
Gani Georgiev 2023-06-22 16:29:58 +03:00
parent dad289b90d
commit 1cbf16b3bf

View File

@ -455,7 +455,7 @@ func newDynamicModel(shape map[string]any) any {
shapeValues = append(shapeValues, reflect.ValueOf(v))
structFields = append(structFields, reflect.StructField{
Name: strings.ToUpper(k), // ensures that the field is exportable
Name: strings.Title(k), // ensures that the field is exportable
Type: vt,
Tag: reflect.StructTag(`db:"` + k + `" json:"` + k + `"`),
})