This commit is contained in:
Liang Ding 2022-12-21 15:18:29 +08:00
parent 29f73e1ef9
commit 52bb34f027
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 37 additions and 1 deletions

View file

@ -25,6 +25,25 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func removeRiffCard(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
deckName := arg["deck"].(string)
blockID := arg["blockID"].(string)
err := model.RemoveFlashcard(blockID, deckName)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
}
func addRiffCard(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)

View file

@ -301,6 +301,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/riff/createRiffDeck", model.CheckAuth, createRiffDeck)
ginServer.Handle("POST", "/api/riff/addRiffCard", model.CheckAuth, addRiffCard)
ginServer.Handle("POST", "/api/riff/removeRiffCard", model.CheckAuth, removeRiffCard)
ginServer.Handle("POST", "/api/notification/pushMsg", model.CheckAuth, pushMsg)
ginServer.Handle("POST", "/api/notification/pushErrMsg", model.CheckAuth, pushErrMsg)