0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-08 13:01:24 -05:00

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]
[:callback ::sm/fn]]]]])
(def ^:private valid-notification?
(sm/validator schema:notification))
(def ^:private check-notification
(sm/check-fn schema:notification))
(defn show
[data]
(dm/assert!
"expected valid notification map"
(valid-notification? data))
(assert (check-notification data) "expected valid notification map")
(ptk/reify ::show
ptk/UpdateEvent