mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 18:06:38 +02:00
✨ Add file soft validation support
This commit is contained in:
parent
ac3d7f00d5
commit
d90e184b4d
3 changed files with 16 additions and 2 deletions
|
@ -275,6 +275,15 @@
|
|||
|
||||
file)
|
||||
|
||||
(defn- soft-validate-file!
|
||||
[file libs]
|
||||
(try
|
||||
(val/validate-file! file libs)
|
||||
(catch Throwable cause
|
||||
(l/error :hint "file validation error"
|
||||
:cause cause)))
|
||||
file)
|
||||
|
||||
(defn- update-file-data
|
||||
[conn file changes skip-validate]
|
||||
(let [file (update file :data (fn [data]
|
||||
|
@ -309,6 +318,9 @@
|
|||
(not skip-validate))
|
||||
(val/validate-file-schema!))
|
||||
|
||||
(cond-> (contains? cf/flags :soft-file-validation)
|
||||
(soft-validate-file! libs))
|
||||
|
||||
(cond-> (contains? cf/flags :soft-file-schema-validation)
|
||||
(soft-validate-file-schema!))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue