mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 Kernel API transferBlockRef https://github.com/siyuan-note/siyuan/issues/8522
This commit is contained in:
parent
4153d22acb
commit
eda8da1bbe
4 changed files with 67 additions and 3 deletions
|
|
@ -117,7 +117,7 @@ func RecentUpdatedBlocks() (ret []*Block) {
|
|||
return
|
||||
}
|
||||
|
||||
func TransferBlockRef(fromID, toID string) (err error) {
|
||||
func TransferBlockRef(fromID, toID string, refIDs []string) (err error) {
|
||||
toTree, _ := loadTreeByBlockID(toID)
|
||||
if nil == toTree {
|
||||
err = ErrBlockNotFound
|
||||
|
|
@ -132,7 +132,9 @@ func TransferBlockRef(fromID, toID string) (err error) {
|
|||
|
||||
util.PushMsg(Conf.Language(116), 7000)
|
||||
|
||||
refIDs, _ := sql.QueryRefIDsByDefID(fromID, false)
|
||||
if 1 > len(refIDs) { // 如果不指定 refIDs,则转移所有引用了 fromID 的块
|
||||
refIDs, _ = sql.QueryRefIDsByDefID(fromID, false)
|
||||
}
|
||||
for _, refID := range refIDs {
|
||||
tree, _ := loadTreeByBlockID(refID)
|
||||
if nil == tree {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue