entc/gen: move mutation hooks logic to a shared generic function (#3180)

This commit is contained in:
Ariel Mashraki
2022-12-19 17:36:29 +02:00
committed by GitHub
parent 4e662b9e51
commit 34bd0b7b6f
443 changed files with 3082 additions and 19327 deletions

View File

@@ -40,6 +40,7 @@ func ({{ $receiver}} *{{ $builder }}) sqlExec(ctx context.Context) (int, error)
if err != nil && sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
{{ $mutation }}.done = true
return affected, err
}