mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-26 17:04:07 +01:00
🎨 Attribute Panel - Database attributes custom sorting https://github.com/siyuan-note/siyuan/issues/11428
This commit is contained in:
parent
0f6a280513
commit
2058f9a0c0
5 changed files with 90 additions and 17 deletions
|
|
@ -211,7 +211,7 @@ func removeAttributeViewKey(c *gin.Context) {
|
|||
util.PushReloadAttrView(avID)
|
||||
}
|
||||
|
||||
func sortAttributeViewKey(c *gin.Context) {
|
||||
func sortAttributeViewViewKey(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
|
|
@ -228,7 +228,30 @@ func sortAttributeViewKey(c *gin.Context) {
|
|||
keyID := arg["keyID"].(string)
|
||||
previousKeyID := arg["previousKeyID"].(string)
|
||||
|
||||
err := model.SortAttributeViewKey(avID, viewID, keyID, previousKeyID)
|
||||
err := model.SortAttributeViewViewKey(avID, viewID, keyID, previousKeyID)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
util.PushReloadAttrView(avID)
|
||||
}
|
||||
|
||||
func sortAttributeViewKey(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)
|
||||
keyID := arg["keyID"].(string)
|
||||
previousKeyID := arg["previousKeyID"].(string)
|
||||
|
||||
err := model.SortAttributeViewKey(avID, keyID, previousKeyID)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
|
|
|
|||
|
|
@ -416,6 +416,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/av/getAttributeViewFilterSort", model.CheckAuth, model.CheckReadonly, getAttributeViewFilterSort)
|
||||
ginServer.Handle("POST", "/api/av/addAttributeViewKey", model.CheckAuth, model.CheckReadonly, addAttributeViewKey)
|
||||
ginServer.Handle("POST", "/api/av/removeAttributeViewKey", model.CheckAuth, model.CheckReadonly, removeAttributeViewKey)
|
||||
ginServer.Handle("POST", "/api/av/sortAttributeViewViewKey", model.CheckAuth, model.CheckReadonly, sortAttributeViewViewKey)
|
||||
ginServer.Handle("POST", "/api/av/sortAttributeViewKey", model.CheckAuth, model.CheckReadonly, sortAttributeViewKey)
|
||||
ginServer.Handle("POST", "/api/av/addAttributeViewValues", model.CheckAuth, model.CheckReadonly, addAttributeViewValues)
|
||||
ginServer.Handle("POST", "/api/av/removeAttributeViewValues", model.CheckAuth, model.CheckReadonly, removeAttributeViewValues)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue