Access route to single book form
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type bookUserGet struct {
|
||||
BookID uint `json:"id"`
|
||||
Title string `json:"title" binding:"required,max=300"`
|
||||
Author string `json:"author" binding:"max=100"`
|
||||
Rating int `json:"rating" binding:"min=0,max=10"`
|
||||
@@ -32,6 +33,7 @@ func GetMyBooksHanderl(ac appcontext.AppContext) {
|
||||
|
||||
func userBookDbToWs(b *model.UserBook) bookUserGet {
|
||||
return bookUserGet{
|
||||
BookID: b.BookID,
|
||||
Title: b.Book.Title,
|
||||
Author: b.Book.Author,
|
||||
Rating: b.Rating,
|
||||
|
||||
Reference in New Issue
Block a user