🎨 Spaced repetition interface supports review by document selection https://github.com/siyuan-note/siyuan/issues/7954

This commit is contained in:
Liang Ding 2023-04-13 19:07:09 +08:00
parent 0ebdd49f8a
commit 66bd5e91a5
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 112 additions and 38 deletions

View file

@ -308,11 +308,27 @@ func lsNotebooks(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
notebooks, err := model.ListNotebooks()
if nil != err {
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
flashcard := false
if arg["flashcard"] != nil {
flashcard = arg["flashcard"].(bool)
}
var notebooks []*model.Box
if flashcard {
notebooks = model.GetFlashcardNotebooks()
} else {
var err error
notebooks, err = model.ListNotebooks()
if nil != err {
return
}
}
ret.Data = map[string]interface{}{
"notebooks": notebooks,
}