瀏覽代碼

fix: can't delete pages that have refs

Also, redirect to home after deleting the page
Tienson Qin 1 年之前
父節點
當前提交
20e4ff133c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/frontend/worker/handler/page.cljs

+ 2 - 2
src/main/frontend/worker/handler/page.cljs

@@ -222,7 +222,7 @@
             (seq (ldb/get-block-property-values @conn (:block/uuid page)))
             {:msg "Page content deleted but unable to delete this page because blocks use this property"})
 
-      (or (seq (:block/_refs page)) (contains? (:block/type page) "hidden"))
+      (contains? (:block/type page) "hidden")
       {:msg "Page content deleted but unable to delete this page because there are still references to it"})
 
     (catch :default e
@@ -273,7 +273,7 @@
 
             (ldb/transact! conn tx-data
                            (cond-> {:outliner-op :delete-page
-                                    :deleted-page page-name
+                                    :deleted-page (str (:block/uuid page))
                                     :persist-op? persist-op?}
                              rename?
                              (assoc :real-outliner-op :rename-page)