🎨 Candidate values of the database relation fields are no longer subject to view filtering https://github.com/siyuan-note/siyuan/issues/10411

This commit is contained in:
Daniel 2024-02-23 22:22:54 +08:00
parent 0226bbb310
commit aea30d12f7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 57 additions and 0 deletions

View file

@ -26,6 +26,40 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func getAttributeViewPrimaryKeyValues(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)
page := 1
pageArg := arg["page"]
if nil != pageArg {
page = int(pageArg.(float64))
}
pageSize := -1
pageSizeArg := arg["pageSize"]
if nil != pageSizeArg {
pageSize = int(pageSizeArg.(float64))
}
rows, err := model.GetAttributeViewPrimaryKeyValues(id, page, pageSize)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
ret.Data = map[string]interface{}{
"rows": rows,
}
}
func addAttributeViewValues(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)