mirror of
https://codeberg.org/pluja/kycnot.me
synced 2025-01-22 12:21:11 -05:00
fix issue with not found services
This commit is contained in:
parent
8863f11bcf
commit
9f561e0702
@ -70,6 +70,7 @@ func (p *PbClient) GetServiceByNameOrUrl(id string) (*Service, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(response.Items) > 0 {
|
||||
service := response.Items[0]
|
||||
|
||||
// Sort attributes by rating
|
||||
@ -82,8 +83,11 @@ func (p *PbClient) GetServiceByNameOrUrl(id string) (*Service, error) {
|
||||
}
|
||||
return ratingOrder[service.Expand["attributes"][i].Rating] > ratingOrder[service.Expand["attributes"][j].Rating]
|
||||
})
|
||||
|
||||
return &service, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("Service not found.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (p *PbClient) GetServiceById(id string) (*Service, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user