mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 14:58:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
1cc838950a
2 changed files with 14 additions and 7 deletions
|
|
@ -55,6 +55,13 @@ func moveBlock(c *gin.Context) {
|
|||
if util.InvalidIDPattern(previousID, ret) {
|
||||
return
|
||||
}
|
||||
|
||||
// Check the validity of the API `moveBlock` parameter `previousID` https://github.com/siyuan-note/siyuan/issues/8007
|
||||
if bt := treenode.GetBlockTree(previousID); nil == bt || "d" == bt.Type {
|
||||
ret.Code = -1
|
||||
ret.Msg = "`previousID` can not be the ID of a document"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
transactions := []*model.Transaction{
|
||||
|
|
|
|||
|
|
@ -308,14 +308,14 @@ func lsNotebooks(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
flashcard := false
|
||||
if arg["flashcard"] != nil {
|
||||
flashcard = arg["flashcard"].(bool)
|
||||
|
||||
// 兼容旧版接口,不能直接使用 util.JsonArg()
|
||||
arg := map[string]interface{}{}
|
||||
if err := c.ShouldBindJSON(&arg); nil == err {
|
||||
if arg["flashcard"] != nil {
|
||||
flashcard = arg["flashcard"].(bool)
|
||||
}
|
||||
}
|
||||
|
||||
var notebooks []*model.Box
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue