🐛 The corresponding entry cannot be found in the database relation https://github.com/siyuan-note/siyuan/issues/10523

This commit is contained in:
Daniel 2024-03-06 09:40:04 +08:00
parent 23c4f81289
commit 8e4dbcfa31
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 10 additions and 4 deletions

View file

@ -55,7 +55,7 @@ func SetDatabaseBlockView(blockID, viewID string) (err error) {
return
}
func GetAttributeViewPrimaryKeyValues(avID string, page, pageSize int) (attributeViewName string, keyValues *av.KeyValues, err error) {
func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int) (attributeViewName string, keyValues *av.KeyValues, err error) {
waitForSyncingStorages()
attrView, err := av.ParseAttributeView(avID)
@ -86,11 +86,13 @@ func GetAttributeViewPrimaryKeyValues(avID string, page, pageSize int) (attribut
}
keyValues.Values = []*av.Value{}
for _, v := range tmp {
keyValues.Values = append(keyValues.Values, v)
if strings.Contains(strings.ToLower(v.String()), strings.ToLower(keyword)) {
keyValues.Values = append(keyValues.Values, v)
}
}
if 1 > pageSize {
pageSize = 50
pageSize = 32
}
start := (page - 1) * pageSize
end := start + pageSize