mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
🎨 The data history of a database view should follow the doc history and data snapshot https://github.com/siyuan-note/siyuan/issues/9567
This commit is contained in:
parent
4ca62ef701
commit
bf6ff5bc32
5 changed files with 119 additions and 2 deletions
|
|
@ -26,6 +26,46 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func renderHistoryAttributeView(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
created := arg["created"].(string)
|
||||
view, attrView, err := model.RenderHistoryAttributeView(id, created)
|
||||
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,
|
||||
"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 renderAttributeView(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue