|
@@ -979,10 +979,12 @@ func (s *InboundService) DelInboundClient(inboundId int, clientId string) (bool,
|
|
|
interfaceClients := settings["clients"].([]any)
|
|
interfaceClients := settings["clients"].([]any)
|
|
|
var newClients []any
|
|
var newClients []any
|
|
|
needApiDel := false
|
|
needApiDel := false
|
|
|
|
|
+ clientFound := false
|
|
|
for _, client := range interfaceClients {
|
|
for _, client := range interfaceClients {
|
|
|
c := client.(map[string]any)
|
|
c := client.(map[string]any)
|
|
|
c_id := c[client_key].(string)
|
|
c_id := c[client_key].(string)
|
|
|
if c_id == clientId {
|
|
if c_id == clientId {
|
|
|
|
|
+ clientFound = true
|
|
|
email, _ = c["email"].(string)
|
|
email, _ = c["email"].(string)
|
|
|
needApiDel, _ = c["enable"].(bool)
|
|
needApiDel, _ = c["enable"].(bool)
|
|
|
} else {
|
|
} 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 {
|
|
if len(newClients) == 0 {
|
|
|
return false, common.NewError("no client remained in Inbound")
|
|
return false, common.NewError("no client remained in Inbound")
|
|
|
}
|
|
}
|