mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Content type filtering when inserting reference links via ((, [[ https://github.com/siyuan-note/siyuan/issues/8009
This commit is contained in:
parent
b13398cbdd
commit
c316951592
3 changed files with 23 additions and 8 deletions
|
|
@ -335,8 +335,13 @@ func QueryRefIDsByDefID(defID string, containChildren bool) (refIDs, refTexts []
|
|||
return
|
||||
}
|
||||
|
||||
func QueryRefsRecent() (ret []*Ref) {
|
||||
rows, err := query("SELECT * FROM refs GROUP BY def_block_id ORDER BY id desc LIMIT 32")
|
||||
func QueryRefsRecent(onlyDoc bool) (ret []*Ref) {
|
||||
stmt := "SELECT * FROM refs"
|
||||
if onlyDoc {
|
||||
stmt = "SELECT * FROM refs WHERE def_block_type = 'd'"
|
||||
}
|
||||
stmt += " GROUP BY def_block_id ORDER BY id DESC LIMIT 32"
|
||||
rows, err := query(stmt)
|
||||
if nil != err {
|
||||
logging.LogErrorf("sql query failed: %s", err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue