Skip to content

Commit

Permalink
Temporary (read: BAD) fix to casing issue in Reactions template vars
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffcaseyyet committed Jan 15, 2024
1 parent b2f2a06 commit 5311636
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/lrsql/util/reaction.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[lrsql.spec.common :as cs]
[lrsql.spec.reaction :as rs]
[lrsql.spec.statement :as ss]
[clojure.string :refer [lower-case]]
[xapi-schema.spec :as xs]))

(s/fdef path->string
Expand Down Expand Up @@ -80,7 +81,10 @@
(walk/postwalk #(if (and (map? %)
(= (key (first %)) "$templatePath"))
(let [input-path (val (first %))
path (update input-path 0 keyword)
path (update input-path 0 (fn [cn]
(-> cn
lower-case
keyword)))
result (get-in cond->statement path :not-found)]
(case result
:not-found (throw (ex-info (str "No value found at " input-path)
Expand Down

0 comments on commit 5311636

Please sign in to comment.