mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
🎨 Improve database field default filling https://github.com/siyuan-note/siyuan/issues/11966
This commit is contained in:
parent
141c139782
commit
8695d86cf1
3 changed files with 122 additions and 39 deletions
|
|
@ -27,6 +27,31 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
// getAttributeViewAddingBlockDefaultValues 用于获取添加块时的默认值。
|
||||
// 存在过滤或分组条件时,添加块时需要填充默认值到过滤字段或分组字段中,前端需要调用该接口来获取这些默认值以便填充。
|
||||
func getAttributeViewAddingBlockDefaultValues(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
avID := arg["avID"].(string)
|
||||
viewID := arg["viewID"].(string)
|
||||
var groupID string
|
||||
if groupIDArg := arg["groupID"]; nil != groupIDArg {
|
||||
groupID = groupIDArg.(string)
|
||||
}
|
||||
var previousID string
|
||||
if nil != arg["previousID"] {
|
||||
previousID = arg["previousID"].(string)
|
||||
}
|
||||
|
||||
ret.Data = model.GetAttrViewAddingBlockDefaultValues(avID, viewID, groupID, previousID)
|
||||
}
|
||||
|
||||
func batchReplaceAttributeViewBlocks(c *gin.Context) {
|
||||
// Add kernel API `/api/av/batchReplaceAttributeViewBlocks` https://github.com/siyuan-note/siyuan/issues/15313
|
||||
ret := gulu.Ret.NewResult()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue