mirror of
https://codeberg.org/pluja/kycnot.me
synced 2025-02-02 01:05:04 -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
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(response.Items) > 0 {
|
||||||
service := response.Items[0]
|
service := response.Items[0]
|
||||||
|
|
||||||
// Sort attributes by rating
|
// 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 ratingOrder[service.Expand["attributes"][i].Rating] > ratingOrder[service.Expand["attributes"][j].Rating]
|
||||||
})
|
})
|
||||||
|
|
||||||
return &service, nil
|
return &service, nil
|
||||||
|
} else {
|
||||||
|
return nil, fmt.Errorf("Service not found.")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PbClient) GetServiceById(id string) (*Service, error) {
|
func (p *PbClient) GetServiceById(id string) (*Service, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user