mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
🎨 Database table view in-table search https://github.com/siyuan-note/siyuan/issues/10419
This commit is contained in:
parent
77ce08d044
commit
1b0ceaaedf
3 changed files with 0 additions and 84 deletions
|
|
@ -39,49 +39,6 @@ func getMirrorDatabaseBlocks(c *gin.Context) {
|
|||
ret.Data = av.GetMirrorBlockIDs(avID)
|
||||
}
|
||||
|
||||
func searchTableView(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, _ := util.JsonArg(c, ret)
|
||||
if nil == arg {
|
||||
return
|
||||
}
|
||||
|
||||
avID := arg["avID"].(string)
|
||||
viewID := arg["viewID"].(string)
|
||||
query := arg["query"].(string)
|
||||
view, attrView, err := model.SearchTableView(avID, viewID, query)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
var views []map[string]interface{}
|
||||
for _, v := range attrView.Views {
|
||||
view := map[string]interface{}{
|
||||
"id": v.ID,
|
||||
"icon": v.Icon,
|
||||
"name": v.Name,
|
||||
"hideAttrViewName": v.HideAttrViewName,
|
||||
"type": v.LayoutType,
|
||||
}
|
||||
|
||||
views = append(views, view)
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"name": attrView.Name,
|
||||
"id": attrView.ID,
|
||||
"viewType": view.GetType(),
|
||||
"viewID": view.GetID(),
|
||||
"views": views,
|
||||
"view": view,
|
||||
"isMirror": av.IsMirror(attrView.ID),
|
||||
}
|
||||
}
|
||||
|
||||
func setDatabaseBlockView(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue