Fix 4734: do not reset id in Delete function
This commit is contained in:
parent
cf00f74882
commit
d91a22c453
@ -59,6 +59,7 @@
|
||||
- Fix 4728: Print wrong file name. [4737](https://github.com/beego/beego/pull/4737)
|
||||
- fix bug:reflect.ValueOf(nil) in getFlatParams [4715](https://github.com/beego/beego/pull/4715)
|
||||
- Fix 4736: set a fixed value "/" to the "Path" of "_xsrf" cookie. [4736](https://github.com/beego/beego/issues/4735)
|
||||
- Fix 4734: do not reset id in Delete function. [4738](https://github.com/beego/beego/pull/4738)
|
||||
|
||||
## Fix Sonar
|
||||
|
||||
|
||||
@ -282,13 +282,7 @@ func (o *ormBase) Delete(md interface{}, cols ...string) (int64, error) {
|
||||
func (o *ormBase) DeleteWithCtx(ctx context.Context, md interface{}, cols ...string) (int64, error) {
|
||||
mi, ind := o.getMiInd(md, true)
|
||||
num, err := o.alias.DbBaser.Delete(ctx, o.db, mi, ind, o.alias.TZ, cols)
|
||||
if err != nil {
|
||||
return num, err
|
||||
}
|
||||
if num > 0 {
|
||||
o.setPk(mi, ind, 0)
|
||||
}
|
||||
return num, nil
|
||||
}
|
||||
|
||||
// create a models to models queryer
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user