Skip to content

Commit

Permalink
#566 Add max=10 validation to Rating in import/watched eps and seasons
Browse files Browse the repository at this point in the history
  • Loading branch information
IRHM committed Jun 28, 2024
1 parent bf45f1a commit 7888e04
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type ImportRequest struct {
Name string `json:"name"`
TmdbID int `json:"tmdbId"`
Type ContentType `json:"type"`
Rating int8 `json:"rating"`
Rating int8 `json:"rating" binding:"max=10"`
RatingCustomDate *time.Time `json:"ratingCustomDate"`
Status WatchedStatus `json:"status"`
Thoughts string `json:"thoughts"`
Expand Down
2 changes: 1 addition & 1 deletion server/watched_episodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type WatchedEpisodeAddRequest struct {
SeasonNumber int `json:"seasonNumber"`
EpisodeNumber int `json:"episodeNumber"`
Status WatchedStatus `json:"status"`
Rating int8 `json:"rating"`
Rating int8 `json:"rating" binding:"max=10"`
addActivity ActivityType `json:"-"`
addActivityDate time.Time `json:"-"`
}
Expand Down
2 changes: 1 addition & 1 deletion server/watched_seasons.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type WatchedSeasonAddRequest struct {
WatchedID uint `json:"watchedId"`
SeasonNumber int `json:"seasonNumber"`
Status WatchedStatus `json:"status"`
Rating int8 `json:"rating"`
Rating int8 `json:"rating" binding:"max=10"`
addActivity ActivityType `json:"-"`
addActivityDate time.Time `json:"-"`
// Data to add to activity if the season is created.
Expand Down

0 comments on commit 7888e04

Please sign in to comment.