Browse Source
Update src/services/user.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
pull/231/head
Ruan Kaylo
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
12 additions and
5 deletions
-
src/services/user.go
|
|
@ -78,14 +78,21 @@ func (service userService) Check(ctx context.Context, request domainUser.CheckRe |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uc := new(domainUser.UserCollection) |
|
|
uc := new(domainUser.UserCollection) |
|
|
|
|
|
if len(resp) == 0 { |
|
|
|
|
|
return response, errors.New("no results found") |
|
|
|
|
|
} |
|
|
for _, item := range resp { |
|
|
for _, item := range resp { |
|
|
|
|
|
verifiedName := "" |
|
|
if item.VerifiedName != nil { |
|
|
if item.VerifiedName != nil { |
|
|
var msg = domainUser.CheckResponseData{Query: item.Query, IsInWhatsapp: item.IsIn, JID: fmt.Sprintf("%s", item.JID), VerifiedName: item.VerifiedName.Details.GetVerifiedName()} |
|
|
|
|
|
uc.Users = append(uc.Users, msg) |
|
|
|
|
|
} else { |
|
|
|
|
|
var msg = domainUser.CheckResponseData{Query: item.Query, IsInWhatsapp: item.IsIn, JID: fmt.Sprintf("%s", item.JID), VerifiedName: ""} |
|
|
|
|
|
uc.Users = append(uc.Users, msg) |
|
|
|
|
|
|
|
|
verifiedName = item.VerifiedName.Details.GetVerifiedName() |
|
|
|
|
|
} |
|
|
|
|
|
msg := domainUser.CheckResponseData{ |
|
|
|
|
|
Query: item.Query, |
|
|
|
|
|
IsInWhatsapp: item.IsIn, |
|
|
|
|
|
JID: item.JID.String(), |
|
|
|
|
|
VerifiedName: verifiedName, |
|
|
} |
|
|
} |
|
|
|
|
|
uc.Users = append(uc.Users, msg) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if len(uc.Users) > 0 { |
|
|
if len(uc.Users) > 0 { |
|
|
|