Skip to content
Snippets Groups Projects
Commit 2d8dda0d authored by Bruno Burke's avatar Bruno Burke :hamburger:
Browse files

postgres: fix type check in load-document for deleted documents

parent 6267fe1a
No related branches found
No related tags found
No related merge requests found
Pipeline #97927 passed
......@@ -53,7 +53,7 @@
(defn load-document
([storage document-id repository]
(when-let [last-document-version (get-last-document-version storage document-id repository)]
(when-not (= (:data-type last-document-version) :delete)
(when-not (= (name (:data-type last-document-version)) "delete")
(load-document storage document-id (:version last-document-version) repository))))
([storage document-id version repository]
(let [restore-document-fn #(restore-document-version storage document-id version repository)]
......
......@@ -16,7 +16,7 @@
(is (= structure
(.load-document @ds-atom id repo)))
(.delete-document @ds-atom id repo)
(is (thrown? Exception (not (.load-document @ds-atom id repo))) "Deleted documents should not be loadable with .load-document")
(is (not (.load-document @ds-atom id repo)) "Deleted documents should not be loadable with .load-document")
(is (not (some #{id} (.list-documents @ds-atom repo))) "Deleted documents should not be listed with .list-documents"))))
(defn test-versioning [ds-atom]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment