mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-13 21:32:28 +00:00
Clamp review thumb rating
This commit is contained in:
parent
eb7cda8997
commit
096a477d0d
1 changed files with 2 additions and 2 deletions
|
@ -112,7 +112,7 @@ public class ReviewController : ControllerBase
|
|||
};
|
||||
this.database.Reviews.Add(review);
|
||||
}
|
||||
review.Thumb = newReview.Thumb;
|
||||
review.Thumb = Math.Clamp(newReview.Thumb, -1, 1);
|
||||
review.LabelCollection = LabelHelper.RemoveInvalidLabels(newReview.LabelCollection);
|
||||
|
||||
review.Text = newReview.Text;
|
||||
|
@ -133,7 +133,7 @@ public class ReviewController : ControllerBase
|
|||
this.database.RatedLevels.Add(ratedLevel);
|
||||
}
|
||||
|
||||
ratedLevel.Rating = newReview.Thumb;
|
||||
ratedLevel.Rating = Math.Clamp(newReview.Thumb, -1, 1);
|
||||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue