Improve notification show params validation assertion

This commit is contained in:
Andrey Antukh 2025-02-18 11:49:29 +01:00
parent 0900b7a572
commit 77f906ae37

View file

@ -51,15 +51,12 @@
[:label :string] [:label :string]
[:callback ::sm/fn]]]]]) [:callback ::sm/fn]]]]])
(def ^:private valid-notification? (def ^:private check-notification
(sm/validator schema:notification)) (sm/check-fn schema:notification))
(defn show (defn show
[data] [data]
(assert (check-notification data) "expected valid notification map")
(dm/assert!
"expected valid notification map"
(valid-notification? data))
(ptk/reify ::show (ptk/reify ::show
ptk/UpdateEvent ptk/UpdateEvent