move radius miles to broker level

This commit is contained in:
Bel LaPointe
2022-01-27 17:39:20 -07:00
parent d38555a555
commit a41ea7d501
4 changed files with 11 additions and 11 deletions

View File

@@ -179,7 +179,7 @@ func (fe FastExact) newRequestWithState(state config.State) (*http.Request, erro
func (fe FastExact) newRequest(zip string) (*http.Request, error) {
req, err := http.NewRequest(
http.MethodGet,
"https://www.fastexact.com/secure/index.php?page=ajaxListJobs&action=ajax&zipcode="+zip+"&records_per_page=50&distance="+strconv.Itoa(config.Get().Brokers.FastExact.RadiusMiles)+"&st_loc_zip=8",
"https://www.fastexact.com/secure/index.php?page=ajaxListJobs&action=ajax&zipcode="+zip+"&records_per_page=50&distance="+strconv.Itoa(config.Get().Brokers.RadiusMiles)+"&st_loc_zip=8",
nil,
)
if err != nil {
@@ -292,7 +292,7 @@ func (mock mockFastExactDoer) doRequest(req *http.Request) (*http.Response, erro
if req.URL.Query().Get("records_per_page") != "50" {
return nil, errors.New("bad query: records_per_page should be 50")
}
if req.URL.Query().Get("distance") != strconv.Itoa(config.Get().Brokers.FastExact.RadiusMiles) {
if req.URL.Query().Get("distance") != strconv.Itoa(config.Get().Brokers.RadiusMiles) {
return nil, errors.New("bad query: distance should be as configured")
}
if req.URL.Query().Get("zipcode") == "" {