Add error message to require-approval validator
Ensure the validation error message shows up properly when users try to approve a manual transaction without assigning financial accounts.
This commit is contained in:
@@ -62,9 +62,10 @@
|
|||||||
|
|
||||||
(defn require-approval [s]
|
(defn require-approval [s]
|
||||||
[:and s
|
[:and s
|
||||||
[:fn (fn [{:transaction/keys [accounts approval-status]}]
|
[:fn {:error/message "Approved transactions must have accounts assigned."}
|
||||||
(or (not= approval-status :transaction-approval-status/approved)
|
(fn [{:transaction/keys [accounts approval-status]}]
|
||||||
(seq accounts)))]])
|
(or (not= approval-status :transaction-approval-status/approved)
|
||||||
|
(seq accounts)))]])
|
||||||
|
|
||||||
(def edit-form-schema
|
(def edit-form-schema
|
||||||
(mc/schema
|
(mc/schema
|
||||||
|
|||||||
Reference in New Issue
Block a user