Skip to content

Commit

Permalink
fix: close #383
Browse files Browse the repository at this point in the history
  • Loading branch information
lucien144 committed Mar 14, 2023
1 parent fa45a11 commit 9d506f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/components/post/post_rating.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class _PostRatingState extends State<PostRating> {
? null
: () {
setState(() => _givingRating = true);
ApiController().giveRating(_post!.idKlub, _post!.id, remove: _post!.myRating != 'none').then((response) {
ApiController().giveRating(_post!.idKlub, _post!.id, remove: _post!.myRating == 'positive').then((response) {
setState(() {
_post!.rating = response.currentRating;
_post!.myRating = response.myRating;
Expand All @@ -101,7 +101,7 @@ class _PostRatingState extends State<PostRating> {
? null
: () {
setState(() => _givingRating = true);
ApiController().giveRating(_post!.idKlub, _post!.id, positive: false, remove: _post!.myRating != 'none').then((response) {
ApiController().giveRating(_post!.idKlub, _post!.id, positive: false, remove: _post!.myRating == 'negative').then((response) {
if (response.needsConfirmation) {
showCupertinoDialog(
context: context,
Expand Down

0 comments on commit 9d506f7

Please sign in to comment.