Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAlireza Ahmadi <alireza.ahmadi@tzconnect.com>2023-03-17 21:29:08 +0300
committerAlireza Ahmadi <alireza.ahmadi@tzconnect.com>2023-03-17 21:29:08 +0300
commit738a771b87d5addce9ca6510dec4e2bdf6ec8c6d (patch)
treeef69068b2e7bb76888025a8cf3a3d0b185eebd3c /web
parent025f559460108ce4f6e55025c08a291796ae4538 (diff)
Fix delete bug
Diffstat (limited to 'web')
-rw-r--r--web/service/inbound.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index fca42edd..b6f4f031 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,12 @@ 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
+ logger.Warning(email)
+ return tx.Where("client_email = ?", email).Delete(model.InboundClientIps{}).Error
}
func (s *InboundService) ResetClientTraffic(id int, clientEmail string) error {