Skip to content

Commit

Permalink
fix: generationmisstake at get resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Simon committed Sep 7, 2023
1 parent 36476e5 commit 00d4058
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generate_code_resolver.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
}
}
var res model.{{$object.Name}}
db = db.First(&res, {{range $primaryFieldKey, $primaryField := $primaryFields}} "{{ lower $primaryField.Name}} = ?",{{$primaryField.Name}}, {{end }})
tableName := r.Sql.Db.Config.NamingStrategy.TableName("{{$object.Name}}")
db = db.First(&res, {{range $primaryFieldKey, $primaryField := $primaryFields}} tableName+".{{ lower $primaryField.Name}} = ?",{{$primaryField.Name}}, {{end }})
if okHook {
r, err := v.AfterCallDb(ctx, &res)
if err != nil {
Expand Down

0 comments on commit 00d4058

Please sign in to comment.