WIP: Add a review button on book form
This commit is contained in:
@@ -27,6 +27,7 @@ type UserBookPutUpdate struct {
|
||||
WantRead *bool `json:"wantread"`
|
||||
Rating *int `json:"rating"`
|
||||
StartDate *string `json:"startDate"`
|
||||
Review *string `json:"review"`
|
||||
}
|
||||
|
||||
type FileInfoPost struct {
|
||||
|
||||
@@ -71,6 +71,9 @@ func PutUserBookHandler(ac appcontext.AppContext) {
|
||||
}
|
||||
updateRating(&userbook, &userBookPut)
|
||||
}
|
||||
if userBookPut.Review != nil {
|
||||
userbook.Review = *userBookPut.Review
|
||||
}
|
||||
ac.Db.Save(&userbook)
|
||||
ac.C.String(http.StatusOK, "Success")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user