mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 08:14:21 +01:00
🎨 Check the validity of the API moveBlock parameter previousID Fix https://github.com/siyuan-note/siyuan/issues/8007
This commit is contained in:
parent
3f66a0d66f
commit
5014a921a4
1 changed files with 7 additions and 0 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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue