diff options
| author | Alireza Ahmadi <alireza.ahmadi@tzconnect.com> | 2023-03-17 21:29:08 +0300 |
|---|---|---|
| committer | Alireza Ahmadi <alireza.ahmadi@tzconnect.com> | 2023-03-17 21:39:26 +0300 |
| commit | 263df2abf5815e7effb46aab5a4c2f9e936b087b (patch) | |
| tree | c6b30da7b866fe83c50b70d8cdf848c5332bf69a | |
| parent | 025f559460108ce4f6e55025c08a291796ae4538 (diff) | |
Fix delete bug
| -rw-r--r-- | web/service/inbound.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go index fca42edd..6e72d0db 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -188,7 +188,7 @@ func (s *InboundService) DelInbound(id int) error { return err } for _, client := range clients { - err := db.Where("client_email = ?", client.Email).Delete(model.InboundClientIps{}).Error + err := s.DelClientIPs(db, client.Email) if err != nil { return err } @@ -523,11 +523,11 @@ func (s *InboundService) UpdateClientIPs(tx *gorm.DB, oldEmail string, newEmail } func (s *InboundService) DelClientStat(tx *gorm.DB, email string) error { - return tx.Where("client_email = ?", email).Delete(xray.ClientTraffic{}).Error + return tx.Where("email = ?", email).Delete(xray.ClientTraffic{}).Error } func (s *InboundService) DelClientIPs(tx *gorm.DB, email string) error { - return tx.Where("email = ?", email).Delete(model.InboundClientIps{}).Error + return tx.Where("client_email = ?", email).Delete(model.InboundClientIps{}).Error } func (s *InboundService) ResetClientTraffic(id int, clientEmail string) error { |
