@@ -368,6 +380,19 @@ function JKPeopleFilter() {
render={({ field }) => }
/>
+
+
+
+ setValue('from_location', e.target.checked)}
+ />
+
+
diff --git a/jam-ui/src/store/features/peopleSlice.js b/jam-ui/src/store/features/peopleSlice.js
index 3084c5e1c..dcf5176b3 100644
--- a/jam-ui/src/store/features/peopleSlice.js
+++ b/jam-ui/src/store/features/peopleSlice.js
@@ -20,6 +20,7 @@ export const fetchPeople = createAsyncThunk(
export const preFetchPeople = createAsyncThunk(
'people/preFetchPeople',
async (options, thunkAPI) => {
+
const response = await getPeople(options)
return response.json()
}
@@ -78,6 +79,7 @@ export const peopleSlice = createSlice({
state.status = 'loading'
})
.addCase(fetchPeople.fulfilled, (state, action) => {
+ //console.log("DEBUG: action.meta.arg", action.meta.arg);
const records = new Set([...state.people, ...action.payload.musicians]);
const unique = [];
records.map(x => unique.filter(a => a.id === x.id).length > 0 ? null : unique.push(x))
diff --git a/web/app/controllers/api_search_controller.rb b/web/app/controllers/api_search_controller.rb
index edde43efb..a912639e6 100644
--- a/web/app/controllers/api_search_controller.rb
+++ b/web/app/controllers/api_search_controller.rb
@@ -127,9 +127,12 @@ class ApiSearchController < ApiController
"ages"=>[],
"skill_level"=>"-1",
"joined_within_days"=>"-1",
- "active_within_days"=>"-1"
+ "active_within_days"=>"-1",
+ "from_location" => "0",
}
+ filter_params.merge!(from_location: params[:from_location] ? '1' : '0')
+
filter_params.merge!(genres: params[:genres]) unless params[:genres].blank?
beginner = ActiveRecord::Type::Boolean.new.type_cast_from_user(params[:proficiency_beginner])