🐛 Fix validation

This commit is contained in:
Andrés Moya 2023-09-21 11:12:00 +02:00
parent 1ab690a408
commit 1fa8888bf3
2 changed files with 4 additions and 4 deletions

View file

@ -133,7 +133,7 @@
(report-error :component-main-external (report-error :component-main-external
(str/format "Main instance should refer to a component in the same file") (str/format "Main instance should refer to a component in the same file")
shape file page)) shape file page))
(let [component (ctf/resolve-component shape file libraries {:include-deleted? true})] (let [component (ctf/resolve-component shape file libraries :include-deleted? true)]
(if (nil? component) (if (nil? component)
(report-error :component-not-found (report-error :component-not-found
(str/format "Component %s not found in file" (:component-id shape) (:component-file shape)) (str/format "Component %s not found in file" (:component-id shape) (:component-file shape))

View file

@ -126,10 +126,10 @@
(defn resolve-component (defn resolve-component
"Retrieve the referenced component, from the local file or from a library" "Retrieve the referenced component, from the local file or from a library"
[shape file libraries & params] [shape file libraries & {:keys [include-deleted?] :or {include-deleted? false}}]
(if (= (:component-file shape) (:id file)) (if (= (:component-file shape) (:id file))
(ctkl/get-component (:data file) (:component-id shape) params) (ctkl/get-component (:data file) (:component-id shape) include-deleted?)
(get-component libraries (:component-file shape) (:component-id shape) params))) (get-component libraries (:component-file shape) (:component-id shape) :include-deleted? include-deleted?)))
(defn get-component-library (defn get-component-library
"Retrieve the library the component belongs to." "Retrieve the library the component belongs to."