WIP: Add a review button on book form

This commit is contained in:
2026-03-13 01:35:06 +01:00
parent d07f18d380
commit 524e517066
7 changed files with 76 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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")
}