0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

💄 Replace us/assert with us/assert! on dashboard data ns

This commit is contained in:
Andrey Antukh 2022-12-07 14:52:07 +01:00
parent 5b9f0ed0b1
commit edaa62b05b

View file

@ -64,7 +64,7 @@
(defn initialize (defn initialize
[{:keys [id] :as params}] [{:keys [id] :as params}]
(us/assert ::us/uuid id) (us/assert! ::us/uuid id)
(ptk/reify ::initialize (ptk/reify ::initialize
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -201,7 +201,7 @@
(defn search (defn search
[params] [params]
(us/assert ::search params) (us/assert! ::search params)
(ptk/reify ::search (ptk/reify ::search
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -236,7 +236,7 @@
(defn fetch-files (defn fetch-files
[{:keys [project-id] :as params}] [{:keys [project-id] :as params}]
(us/assert ::us/uuid project-id) (us/assert! ::us/uuid project-id)
(ptk/reify ::fetch-files (ptk/reify ::fetch-files
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]
@ -347,7 +347,7 @@
(defn toggle-file-select (defn toggle-file-select
[{:keys [id project-id] :as file}] [{:keys [id project-id] :as file}]
(us/assert ::file file) (us/assert! ::file file)
(ptk/reify ::toggle-file-select (ptk/reify ::toggle-file-select
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -377,7 +377,7 @@
(defn create-team (defn create-team
[{:keys [name] :as params}] [{:keys [name] :as params}]
(us/assert string? name) (us/assert! ::us/string name)
(ptk/reify ::create-team (ptk/reify ::create-team
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]
@ -394,7 +394,7 @@
(defn create-team-with-invitations (defn create-team-with-invitations
[{:keys [name emails role] :as params}] [{:keys [name emails role] :as params}]
(us/assert string? name) (us/assert! ::us/string name)
(ptk/reify ::create-team-with-invitations (ptk/reify ::create-team-with-invitations
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]
@ -413,7 +413,7 @@
(defn update-team (defn update-team
[{:keys [id name] :as params}] [{:keys [id name] :as params}]
(us/assert ::team params) (us/assert! ::team params)
(ptk/reify ::update-team (ptk/reify ::update-team
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -426,7 +426,7 @@
(defn update-team-photo (defn update-team-photo
[{:keys [file] :as params}] [{:keys [file] :as params}]
(us/assert ::di/file file) (us/assert! ::di/file file)
(ptk/reify ::update-team-photo (ptk/reify ::update-team-photo
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
@ -447,8 +447,8 @@
(defn update-team-member-role (defn update-team-member-role
[{:keys [role member-id] :as params}] [{:keys [role member-id] :as params}]
(us/assert ::us/uuid member-id) (us/assert! ::us/uuid member-id)
(us/assert ::us/keyword role) (us/assert! ::us/keyword role)
(ptk/reify ::update-team-member-role (ptk/reify ::update-team-member-role
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
@ -461,7 +461,7 @@
(defn delete-team-member (defn delete-team-member
[{:keys [member-id] :as params}] [{:keys [member-id] :as params}]
(us/assert ::us/uuid member-id) (us/assert! ::us/uuid member-id)
(ptk/reify ::delete-team-member (ptk/reify ::delete-team-member
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
@ -474,7 +474,9 @@
(defn leave-team (defn leave-team
[{:keys [reassign-to] :as params}] [{:keys [reassign-to] :as params}]
(us/assert (s/nilable ::us/uuid) reassign-to) (us/assert!
:spec (s/nilable ::us/uuid)
:val reassign-to)
(ptk/reify ::leave-team (ptk/reify ::leave-team
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
@ -510,9 +512,9 @@
(defn update-team-invitation-role (defn update-team-invitation-role
[{:keys [email team-id role] :as params}] [{:keys [email team-id role] :as params}]
(us/assert ::us/email email) (us/assert! ::us/email email)
(us/assert ::us/uuid team-id) (us/assert! ::us/uuid team-id)
(us/assert ::us/keyword role) (us/assert! ::us/keyword role)
(ptk/reify ::update-team-invitation-role (ptk/reify ::update-team-invitation-role
IDeref IDeref
(-deref [_] {:role role}) (-deref [_] {:role role})
@ -528,8 +530,8 @@
(defn delete-team-invitation (defn delete-team-invitation
[{:keys [email team-id] :as params}] [{:keys [email team-id] :as params}]
(us/assert ::us/email email) (us/assert! ::us/email email)
(us/assert ::us/uuid team-id) (us/assert! ::us/uuid team-id)
(ptk/reify ::delete-team-invitation (ptk/reify ::delete-team-invitation
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]
@ -542,7 +544,7 @@
(defn delete-team-webhook (defn delete-team-webhook
[{:keys [id] :as params}] [{:keys [id] :as params}]
(us/assert ::us/uuid id) (us/assert! ::us/uuid id)
(ptk/reify ::delete-team-webhook (ptk/reify ::delete-team-webhook
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
@ -562,10 +564,10 @@
(defn update-team-webhook (defn update-team-webhook
[{:keys [id uri mtype is-active] :as params}] [{:keys [id uri mtype is-active] :as params}]
(us/assert ::us/uuid id) (us/assert! ::us/uuid id)
(us/assert ::us/uri uri) (us/assert! ::us/uri uri)
(us/assert ::mtype mtype) (us/assert! ::mtype mtype)
(us/assert ::us/boolean is-active) (us/assert! ::us/boolean is-active)
(ptk/reify ::update-team-webhook (ptk/reify ::update-team-webhook
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
@ -580,9 +582,9 @@
(defn create-team-webhook (defn create-team-webhook
[{:keys [uri mtype is-active] :as params}] [{:keys [uri mtype is-active] :as params}]
(us/assert ::us/uri uri) (us/assert! ::us/uri uri)
(us/assert ::mtype mtype) (us/assert! ::mtype mtype)
(us/assert ::us/boolean is-active) (us/assert! ::us/boolean is-active)
(ptk/reify ::create-team-webhook (ptk/reify ::create-team-webhook
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
@ -599,7 +601,7 @@
(defn delete-team (defn delete-team
[{:keys [id] :as params}] [{:keys [id] :as params}]
(us/assert ::team params) (us/assert! ::team params)
(ptk/reify ::delete-team (ptk/reify ::delete-team
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]
@ -652,7 +654,7 @@
(defn duplicate-project (defn duplicate-project
[{:keys [id name] :as params}] [{:keys [id name] :as params}]
(us/assert ::us/uuid id) (us/assert! ::us/uuid id)
(ptk/reify ::duplicate-project (ptk/reify ::duplicate-project
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]
@ -669,8 +671,8 @@
(defn move-project (defn move-project
[{:keys [id team-id] :as params}] [{:keys [id team-id] :as params}]
(us/assert ::us/uuid id) (us/assert! ::us/uuid id)
(us/assert ::us/uuid team-id) (us/assert! ::us/uuid team-id)
(ptk/reify ::move-project (ptk/reify ::move-project
IDeref IDeref
(-deref [_] (-deref [_]
@ -688,7 +690,7 @@
(defn toggle-project-pin (defn toggle-project-pin
[{:keys [id is-pinned] :as project}] [{:keys [id is-pinned] :as project}]
(us/assert ::project project) (us/assert! ::project project)
(ptk/reify ::toggle-project-pin (ptk/reify ::toggle-project-pin
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -705,7 +707,7 @@
(defn rename-project (defn rename-project
[{:keys [id name] :as params}] [{:keys [id name] :as params}]
(us/assert ::project params) (us/assert! ::project params)
(ptk/reify ::rename-project (ptk/reify ::rename-project
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -723,7 +725,7 @@
(defn delete-project (defn delete-project
[{:keys [id] :as params}] [{:keys [id] :as params}]
(us/assert ::project params) (us/assert! ::project params)
(ptk/reify ::delete-project (ptk/reify ::delete-project
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -745,7 +747,7 @@
(defn delete-file (defn delete-file
[{:keys [id project-id] :as params}] [{:keys [id project-id] :as params}]
(us/assert ::file params) (us/assert! ::file params)
(ptk/reify ::delete-file (ptk/reify ::delete-file
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -764,7 +766,7 @@
(defn rename-file (defn rename-file
[{:keys [id name] :as params}] [{:keys [id name] :as params}]
(us/assert ::file params) (us/assert! ::file params)
(ptk/reify ::rename-file (ptk/reify ::rename-file
IDeref IDeref
(-deref [_] (-deref [_]
@ -787,7 +789,7 @@
(defn set-file-shared (defn set-file-shared
[{:keys [id is-shared] :as params}] [{:keys [id is-shared] :as params}]
(us/assert ::file params) (us/assert! ::file params)
(ptk/reify ::set-file-shared (ptk/reify ::set-file-shared
IDeref IDeref
(-deref [_] (-deref [_]
@ -828,7 +830,7 @@
(defn create-file (defn create-file
[{:keys [project-id] :as params}] [{:keys [project-id] :as params}]
(us/assert ::us/uuid project-id) (us/assert! ::us/uuid project-id)
(ptk/reify ::create-file (ptk/reify ::create-file
IDeref IDeref
@ -857,8 +859,8 @@
(defn duplicate-file (defn duplicate-file
[{:keys [id name] :as params}] [{:keys [id name] :as params}]
(us/assert ::us/uuid id) (us/assert! ::us/uuid id)
(us/assert ::name name) (us/assert! ::name name)
(ptk/reify ::duplicate-file (ptk/reify ::duplicate-file
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]
@ -877,8 +879,8 @@
(defn move-files (defn move-files
[{:keys [ids project-id] :as params}] [{:keys [ids project-id] :as params}]
(us/assert ::us/set-of-uuid ids) (us/assert! ::us/set-of-uuid ids)
(us/assert ::us/uuid project-id) (us/assert! ::us/uuid project-id)
(ptk/reify ::move-files (ptk/reify ::move-files
IDeref IDeref
(-deref [_] (-deref [_]
@ -898,7 +900,7 @@
;; --- EVENT: clone-template ;; --- EVENT: clone-template
(defn clone-template (defn clone-template
[{:keys [template-id project-id] :as params}] [{:keys [template-id project-id] :as params}]
(us/assert ::us/uuid project-id) (us/assert! ::us/uuid project-id)
(ptk/reify ::clone-template (ptk/reify ::clone-template
IDeref IDeref
(-deref [_] (-deref [_]
@ -920,7 +922,7 @@
(defn go-to-workspace (defn go-to-workspace
[{:keys [id project-id] :as file}] [{:keys [id project-id] :as file}]
(us/assert ::file file) (us/assert! ::file file)
(ptk/reify ::go-to-workspace (ptk/reify ::go-to-workspace
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]