add filter read/want read when browsing books
This commit is contained in:
19
internal/routes/userbookreadget.go
Normal file
19
internal/routes/userbookreadget.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.artlef.fr/PersonalLibraryManager/internal/appcontext"
|
||||
"git.artlef.fr/PersonalLibraryManager/internal/myvalidator"
|
||||
"git.artlef.fr/PersonalLibraryManager/internal/query"
|
||||
)
|
||||
|
||||
func GetMyBooksReadHandler(ac appcontext.AppContext) {
|
||||
user, err := ac.GetAuthenticatedUser()
|
||||
if err != nil {
|
||||
myvalidator.ReturnErrorsAsJsonResponse(&ac, err)
|
||||
return
|
||||
}
|
||||
userbooks, err := query.FetchReadUserBook(ac.Db, user.ID)
|
||||
ac.C.JSON(http.StatusOK, userbooks)
|
||||
}
|
||||
Reference in New Issue
Block a user