Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-02-01 10:20:50 +08:00
parent 4ce296d7ae
commit 89536ceb19
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 21 additions and 9 deletions

View file

@ -35,10 +35,15 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func RenderAttributeView(blockID, avID, viewID, query string, page, pageSize int, groupPaging map[string]interface{}) (viewable av.Viewable, attrView *av.AttributeView, err error) {
func RenderAttributeView(blockID, avID, viewID, query string, page, pageSize int, groupPaging map[string]interface{}, createIfNotExist bool) (viewable av.Viewable, attrView *av.AttributeView, err error) {
waitForSyncingStorages()
if avJSONPath := av.GetAttributeViewDataPath(avID); !filelock.IsExist(avJSONPath) {
if !createIfNotExist {
err = av.ErrAttributeViewNotFound
return
}
attrView = av.NewAttributeView(avID)
if err = av.SaveAttributeView(attrView); err != nil {
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)