소스 검색

fix: should not remove child block

Peng Xiao 3 년 전
부모
커밋
e9e2df17df
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/main/frontend/handler/whiteboard.cljs

+ 4 - 1
src/main/frontend/handler/whiteboard.cljs

@@ -76,7 +76,10 @@
                     :block/whiteboard? true
                     :block/properties (dissoc tldr-data :shapes)}
         ;; todo: use get-paginated-blocks instead?
-        existing-blocks (model/get-page-blocks-no-cache page-name)
+        existing-blocks (model/get-page-blocks-no-cache (state/get-current-repo) 
+                                                        page-name
+                                                        {:pull-keys '[:block/uuid
+                                                                      {:block/parent [:block/uuid]}]})
         shapes (:shapes tldr-data)
         blocks (mapv #(shape->block % page-name) shapes)
         block-ids (->> shapes