mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
Add more specs to image collections events.
This commit is contained in:
parent
1172c56dfa
commit
3a75a07de5
1 changed files with 13 additions and 0 deletions
|
@ -28,10 +28,19 @@
|
|||
(s/def ::mimetype string?)
|
||||
(s/def ::thumbnail us/url-str?)
|
||||
(s/def ::id uuid?)
|
||||
(s/def ::version integer?)
|
||||
(s/def ::url us/url-str?)
|
||||
(s/def ::collection (s/nilable uuid?))
|
||||
(s/def ::user uuid?)
|
||||
|
||||
(s/def ::collection-entity
|
||||
(s/keys :req-un [::id
|
||||
::name
|
||||
::created-at
|
||||
::modified-at
|
||||
::user
|
||||
::version]))
|
||||
|
||||
(s/def ::image-entity
|
||||
(s/keys :req-un [::id
|
||||
::name
|
||||
|
@ -42,6 +51,7 @@
|
|||
::mimetype
|
||||
::thumbnail
|
||||
::url
|
||||
::version
|
||||
::collection
|
||||
::user]))
|
||||
|
||||
|
@ -98,6 +108,7 @@
|
|||
|
||||
(defn collections-fetched
|
||||
[items]
|
||||
{:pre [(us/valid? (s/every ::collection-entity) items)]}
|
||||
(CollectionsFetched. items))
|
||||
|
||||
;; --- Fetch Color Collections
|
||||
|
@ -127,6 +138,7 @@
|
|||
|
||||
(defn collection-created
|
||||
[item]
|
||||
{:pre [(us/valid? ::collection-entity item)]}
|
||||
(CollectionCreated. item))
|
||||
|
||||
;; --- Create Collection
|
||||
|
@ -157,6 +169,7 @@
|
|||
|
||||
(defn collection-updated
|
||||
[item]
|
||||
{:pre [(us/valid? ::collection-entity item)]}
|
||||
(CollectionUpdated. item))
|
||||
|
||||
;; --- Update Collection
|
||||
|
|
Loading…
Add table
Reference in a new issue