This commit is contained in:
Liang Ding 2022-06-15 23:56:47 +08:00
parent 4170f50dc6
commit 102d9364fd
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
25 changed files with 118 additions and 398 deletions

View file

@ -17,13 +17,14 @@
package api
import (
"errors"
"fmt"
"net/http"
"github.com/88250/gulu"
"github.com/88250/lute/html"
"github.com/gin-gonic/gin"
"github.com/siyuan-note/siyuan/kernel/filesys"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/siyuan/kernel/model"
"github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/util"
@ -73,7 +74,7 @@ func checkBlockExist(c *gin.Context) {
id := arg["id"].(string)
b, err := model.GetBlock(id)
if filesys.ErrUnableLockFile == err {
if errors.Is(err, filelock.ErrUnableLockFile) {
ret.Code = 2
ret.Data = id
return
@ -221,7 +222,7 @@ func getBlockInfo(c *gin.Context) {
id := arg["id"].(string)
block, err := model.GetBlock(id)
if filesys.ErrUnableLockFile == err {
if errors.Is(err, filelock.ErrUnableLockFile) {
ret.Code = 2
ret.Data = id
return
@ -247,7 +248,7 @@ func getBlockInfo(c *gin.Context) {
}
root, err := model.GetBlock(block.RootID)
if filesys.ErrUnableLockFile == err {
if errors.Is(err, filelock.ErrUnableLockFile) {
ret.Code = 2
ret.Data = id
return