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]
|
||||
[:and s
|
||||
[:fn (fn [{:transaction/keys [accounts approval-status]}]
|
||||
(or (not= approval-status :transaction-approval-status/approved)
|
||||
(seq accounts)))]])
|
||||
[:fn {:error/message "Approved transactions must have accounts assigned."}
|
||||
(fn [{:transaction/keys [accounts approval-status]}]
|
||||
(or (not= approval-status :transaction-approval-status/approved)
|
||||
(seq accounts)))]])
|
||||
|
||||
(def edit-form-schema
|
||||
(mc/schema
|
||||
|
||||
Reference in New Issue
Block a user