mirror of
https://github.com/penpot/penpot.git
synced 2025-05-27 20:16:10 +02: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 ::mimetype string?)
|
||||||
(s/def ::thumbnail us/url-str?)
|
(s/def ::thumbnail us/url-str?)
|
||||||
(s/def ::id uuid?)
|
(s/def ::id uuid?)
|
||||||
|
(s/def ::version integer?)
|
||||||
(s/def ::url us/url-str?)
|
(s/def ::url us/url-str?)
|
||||||
(s/def ::collection (s/nilable uuid?))
|
(s/def ::collection (s/nilable uuid?))
|
||||||
(s/def ::user 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/def ::image-entity
|
||||||
(s/keys :req-un [::id
|
(s/keys :req-un [::id
|
||||||
::name
|
::name
|
||||||
|
@ -42,6 +51,7 @@
|
||||||
::mimetype
|
::mimetype
|
||||||
::thumbnail
|
::thumbnail
|
||||||
::url
|
::url
|
||||||
|
::version
|
||||||
::collection
|
::collection
|
||||||
::user]))
|
::user]))
|
||||||
|
|
||||||
|
@ -98,6 +108,7 @@
|
||||||
|
|
||||||
(defn collections-fetched
|
(defn collections-fetched
|
||||||
[items]
|
[items]
|
||||||
|
{:pre [(us/valid? (s/every ::collection-entity) items)]}
|
||||||
(CollectionsFetched. items))
|
(CollectionsFetched. items))
|
||||||
|
|
||||||
;; --- Fetch Color Collections
|
;; --- Fetch Color Collections
|
||||||
|
@ -127,6 +138,7 @@
|
||||||
|
|
||||||
(defn collection-created
|
(defn collection-created
|
||||||
[item]
|
[item]
|
||||||
|
{:pre [(us/valid? ::collection-entity item)]}
|
||||||
(CollectionCreated. item))
|
(CollectionCreated. item))
|
||||||
|
|
||||||
;; --- Create Collection
|
;; --- Create Collection
|
||||||
|
@ -157,6 +169,7 @@
|
||||||
|
|
||||||
(defn collection-updated
|
(defn collection-updated
|
||||||
[item]
|
[item]
|
||||||
|
{:pre [(us/valid? ::collection-entity item)]}
|
||||||
(CollectionUpdated. item))
|
(CollectionUpdated. item))
|
||||||
|
|
||||||
;; --- Update Collection
|
;; --- Update Collection
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue