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
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2026-05-04 18:00:09 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2026-05-04 18:00:09 +0300
commite9979b6774a24d88fdfda242be7b7f8e226fb091 (patch)
tree73bcdb6aa4bce6422654315e96d575e6088cfc06
parent2b83dc047b6a318e60c9bdc75a63d46196dc3b5d (diff)
API: Check client existence
#3706
-rw-r--r--web/service/inbound.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index 8ab5e6a8..74b44b99 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -979,10 +979,12 @@ func (s *InboundService) DelInboundClient(inboundId int, clientId string) (bool,
interfaceClients := settings["clients"].([]any)
var newClients []any
needApiDel := false
+ clientFound := false
for _, client := range interfaceClients {
c := client.(map[string]any)
c_id := c[client_key].(string)
if c_id == clientId {
+ clientFound = true
email, _ = c["email"].(string)
needApiDel, _ = c["enable"].(bool)
} else {
@@ -990,6 +992,10 @@ func (s *InboundService) DelInboundClient(inboundId int, clientId string) (bool,
}
}
+ if !clientFound {
+ return false, common.NewError("Client Not Found In Inbound For ID:", clientId)
+ }
+
if len(newClients) == 0 {
return false, common.NewError("no client remained in Inbound")
}