Skip to content

Commit 4c440cb

Browse files
authored
Merge pull request #566 from danieroux/configuration-index-root-for-reindexing
Use `(ah/app-algorithm app :index-root!)` for `(defmutation reindex)`
2 parents bcfc284 + 84fe247 commit 4c440cb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/com/fulcrologic/fulcro/algorithms/indexing.cljc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
(:require
77
[clojure.set :as set]
88
[com.fulcrologic.fulcro.algorithms.denormalize :as fdn]
9+
[com.fulcrologic.fulcro.algorithms.lookup :as ah]
910
[com.fulcrologic.fulcro.mutations :refer [defmutation]]
1011
[com.fulcrologic.fulcro.raw.components :as rc]
1112
[edn-query-language.core :as eql]
@@ -129,6 +130,6 @@
129130
"Mutation: re-index the application (typically after a dynamic query change)."
130131
[_]
131132
(action [{:keys [app]}]
132-
(if app
133-
(index-root! app)
133+
(if-let [index-root-set-in-app! (ah/app-algorithm app :index-root!)]
134+
(index-root-set-in-app! app)
134135
(log/error "Unable to re-index root. App was not set in the mutation env. See https://book.fulcrologic.com/#err-idx-missing-app"))))

0 commit comments

Comments
 (0)