mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 块引用与所引用的内容块进行交换 https://github.com/siyuan-note/siyuan/issues/4981
This commit is contained in:
parent
8b8859bc54
commit
875ffca004
3 changed files with 75 additions and 0 deletions
|
|
@ -31,6 +31,26 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func swapBlockRef(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
refID := arg["refID"].(string)
|
||||
defID := arg["defID"].(string)
|
||||
err := model.SwapBlockRef(refID, defID)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 7000}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func getHeadingChildrenDOM(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue