Skip to content

Commit bd2b4bd

Browse files
committed
feat: expose add and delete block
1 parent df936ab commit bd2b4bd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

collab-document/src/document.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ impl DocumentBody {
645645
Ok(buf)
646646
}
647647

648-
fn insert_block(
648+
pub fn insert_block(
649649
&self,
650650
txn: &mut TransactionMut,
651651
block: Block,
@@ -709,7 +709,11 @@ impl DocumentBody {
709709
/// 1. delete all the children of this block
710710
/// 2. delete the block from its parent
711711
/// 3. delete the block from the block map
712-
fn delete_block(&self, txn: &mut TransactionMut, block_id: &str) -> Result<(), DocumentError> {
712+
pub fn delete_block(
713+
&self,
714+
txn: &mut TransactionMut,
715+
block_id: &str,
716+
) -> Result<(), DocumentError> {
713717
let block = match self.block_operation.get_block_with_txn(txn, block_id) {
714718
Some(block) => block,
715719
None => return Err(DocumentError::BlockIsNotFound),

0 commit comments

Comments
 (0)