This commit is contained in:
Daniel 2024-03-06 16:21:17 +08:00
parent 1f22227758
commit f0efd8ac67
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 63 additions and 0 deletions

View file

@ -39,6 +39,25 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func SearchTableView(avID, viewID, keyword string) (viewable av.Viewable, attrView *av.AttributeView, err error) {
if avJSONPath := av.GetAttributeViewDataPath(avID); !filelock.IsExist(avJSONPath) {
attrView = av.NewAttributeView(avID)
if err = av.SaveAttributeView(attrView); nil != err {
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)
return
}
}
attrView, err = av.ParseAttributeView(avID)
if nil != err {
logging.LogErrorf("parse attribute view [%s] failed: %s", avID, err)
return
}
viewable, err = renderAttributeView(attrView, viewID, 1, -1)
return
}
func SetDatabaseBlockView(blockID, viewID string) (err error) {
node, tree, err := getNodeByBlockID(nil, blockID)
if nil != err {