mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 14:52:41 +08:00
🎨 Rows non-bound in the database support Add to Database
https://github.com/siyuan-note/siyuan/issues/11093
This commit is contained in:
parent
9157a6e6e6
commit
e16c3cb0fe
@ -318,7 +318,13 @@ func searchAttributeView(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
keyword := arg["keyword"].(string)
|
keyword := arg["keyword"].(string)
|
||||||
results := model.SearchAttributeView(keyword)
|
var excludes []string
|
||||||
|
if nil != arg["excludes"] {
|
||||||
|
for _, e := range arg["excludes"].([]interface{}) {
|
||||||
|
excludes = append(excludes, e.(string))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
results := model.SearchAttributeView(keyword, excludes)
|
||||||
ret.Data = map[string]interface{}{
|
ret.Data = map[string]interface{}{
|
||||||
"results": results,
|
"results": results,
|
||||||
}
|
}
|
||||||
|
@ -186,8 +186,9 @@ type SearchAttributeViewResult struct {
|
|||||||
HPath string `json:"hPath"`
|
HPath string `json:"hPath"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func SearchAttributeView(keyword string) (ret []*SearchAttributeViewResult) {
|
func SearchAttributeView(keyword string, excludes []string) (ret []*SearchAttributeViewResult) {
|
||||||
waitForSyncingStorages()
|
waitForSyncingStorages()
|
||||||
|
|
||||||
ret = []*SearchAttributeViewResult{}
|
ret = []*SearchAttributeViewResult{}
|
||||||
keyword = strings.TrimSpace(keyword)
|
keyword = strings.TrimSpace(keyword)
|
||||||
|
|
||||||
@ -321,7 +322,7 @@ func SearchAttributeView(keyword string) (ret []*SearchAttributeViewResult) {
|
|||||||
hPath = box.Name + hPath
|
hPath = box.Name + hPath
|
||||||
}
|
}
|
||||||
|
|
||||||
if !exist {
|
if !exist && !gulu.Str.Contains(avID, excludes) {
|
||||||
ret = append(ret, &SearchAttributeViewResult{
|
ret = append(ret, &SearchAttributeViewResult{
|
||||||
AvID: avID,
|
AvID: avID,
|
||||||
AvName: existAv.AvName,
|
AvName: existAv.AvName,
|
||||||
|
Loading…
Reference in New Issue
Block a user