FIX: simplifies updating searchedTerms from connectors (#10674)

FIX: simplifies updating searchedTerms from connectors (#10674)

diff --git a/app/assets/javascripts/discourse/app/components/search-advanced-options.js b/app/assets/javascripts/discourse/app/components/search-advanced-options.js
index 37bf5c2..ecea323 100644
--- a/app/assets/javascripts/discourse/app/components/search-advanced-options.js
+++ b/app/assets/javascripts/discourse/app/components/search-advanced-options.js
@@ -412,6 +412,12 @@ export default Component.extend({
     this.updateInRegex(REGEXP_SPECIAL_IN_TITLE_MATCH, "title");
   },
 
+  @action
+  onChangeSearchedTermField(path, updateFnName, value) {
+    this.set(`searchedTerms.${path}`, value);
+    this[updateFnName]();
+  },
+
   _updateSearchTermForTags() {
     const match = this.filterBlocks(REGEXP_TAGS_PREFIX);
     const tagFilter = this.get("searchedTerms.tags");
diff --git a/app/assets/javascripts/discourse/app/templates/components/search-advanced-options.hbs b/app/assets/javascripts/discourse/app/templates/components/search-advanced-options.hbs
index 3994363..e18885b 100644
--- a/app/assets/javascripts/discourse/app/templates/components/search-advanced-options.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/search-advanced-options.hbs
@@ -1,4 +1,4 @@
-{{plugin-outlet name="advanced-search-options-above" args=(hash searchedTerms=searchedTerms) tagName=""}}
+{{plugin-outlet name="advanced-search-options-above" args=(hash searchedTerms=searchedTerms onChangeSearchedTermField=onChangeSearchedTermField) tagName=""}}
 
 <div class="container advanced-search-posted-by-group">
   <div class="control-group pull-left">
@@ -162,4 +162,4 @@
   </div>
 </div>
 
-{{plugin-outlet name="advanced-search-options-below" args=(hash searchedTerms=searchedTerms) tagName=""}}
+{{plugin-outlet name="advanced-search-options-below" args=(hash searchedTerms=searchedTerms onChangeSearchedTermField=onChangeSearchedTermField) tagName=""}}

GitHub sha: 53e281a3

This commit appears in #10674 which was merged by jjaffeux.