mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 06:46:09 +01:00
♻️ Refactor av data structure
This commit is contained in:
parent
2f99364071
commit
bd95fdc5d7
8 changed files with 724 additions and 582 deletions
|
|
@ -35,13 +35,27 @@ func renderAttributeView(c *gin.Context) {
|
|||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
av, err := model.RenderAttributeView(id)
|
||||
view, attrView, err := model.RenderAttributeView(id)
|
||||
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,
|
||||
"name": v.Name,
|
||||
}
|
||||
|
||||
views = append(views, view)
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"av": av,
|
||||
"name": attrView.Name,
|
||||
"views": views,
|
||||
"viewType": view.Type(),
|
||||
"view": view,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue