mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 05:39:54 +05:00
SetTPDerivedChargers in sql fix, thanks @J0hnSteel
This commit is contained in:
@@ -409,14 +409,14 @@ func (self *SQLStorage) SetTPDerivedChargers(sgs []*utils.TPDerivedChargers) err
|
||||
dcKey := dCharger.GetDerivedChargersKey()
|
||||
if found, _ := m[dcKey]; !found {
|
||||
m[dcKey] = true
|
||||
if err := tx.Delete(TpDerivedCharger{
|
||||
if err := tx.Where(TpDerivedCharger{
|
||||
Tpid: dCharger.TPid,
|
||||
Direction: dCharger.Direction,
|
||||
Tenant: dCharger.Tenant,
|
||||
Category: dCharger.Category,
|
||||
Account: dCharger.Account,
|
||||
Subject: dCharger.Subject,
|
||||
}).Error; err != nil {
|
||||
}).Delete(TpDerivedCharger{}).Error; err != nil {
|
||||
tx.Rollback()
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user