Skip to content

Commit

Permalink
s.db
Browse files Browse the repository at this point in the history
  • Loading branch information
Pipello committed Mar 15, 2024
1 parent 69acf77 commit 60c9d18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions definition/service.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s *{{$modelName}}Service) Create(ctx context.Context, req *pb.Create{{$mod
{{if not $field.Relationship}}{{$field.Name}}: req.{{$modelName}}.{{$field.GoCamelCaseName}},{{end}}
{{- end }}
}
if err := item.Validate(db); err != nil {
if err := item.Validate(s.db); err != nil {
return nil, status.Error(codes.InvalidArgument,
fmt.Sprintf("{{$modelName}} is not valid, %v", err))
}
Expand Down Expand Up @@ -114,7 +114,7 @@ func (s *{{$modelName}}Service) Update(ctx context.Context, req *pb.Update{{$mod
{{- end }}
}
}
if err := item.Validate(db); err != nil {
if err := item.Validate(s.db); err != nil {
return nil, status.Error(codes.InvalidArgument,
fmt.Sprintf("{{$modelName}} is not valid, %v", err))
}
Expand Down

0 comments on commit 60c9d18

Please sign in to comment.