🎨 Add Duplicate non-mirror database block https://github.com/siyuan-note/siyuan/issues/11460

This commit is contained in:
Daniel 2024-05-23 18:00:35 +08:00
parent aaeda056fa
commit f197a4ea87
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 64 additions and 0 deletions

View file

@ -27,6 +27,29 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func duplicateAttributeViewBlock(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
avID := arg["avID"].(string)
newAvID, newBlockID, err := model.DuplicateDatabaseBlock(avID)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
ret.Data = map[string]interface{}{
"avID": newAvID,
"blockID": newBlockID,
}
}
func getAttributeViewKeysByAvID(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)