Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
Fix upvote error
Browse files Browse the repository at this point in the history
  • Loading branch information
issyrocks12 committed Apr 25, 2017
1 parent 45cb23a commit cfcca8b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Listeners/SaveVotesToDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event)
if ($vote->type == 'Up') {
$post->user->decrement('votes');

if ($post->number = 1) {
if ($post->number == 1) {
$discussion->decrement('votes');
}

Expand All @@ -86,7 +86,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event)
} else {
$post->user->increment('votes');

if ($post->number = 1) {
if ($post->number == 1) {
$discussion->increment('votes');
}

Expand All @@ -102,7 +102,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event)

$post->user->votes = $post->user->votes - 2;

if ($post->number = 1) {
if ($post->number == 1) {
$discussion->votes = $discussion->votes - 2;
}

Expand All @@ -116,7 +116,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event)

$post->user->votes = $post->user->votes + 2;

if ($post->number = 1) {
if ($post->number == 1) {
$discussion->votes = $discussion->votes + 2;
}

Expand All @@ -129,7 +129,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event)

$post->user->decrement('votes');

if ($post->number = 1) {
if ($post->number == 1) {
$discussion->decrement('votes');
}

Expand All @@ -141,7 +141,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event)

$post->user->increment('votes');

if ($post->number = 1) {
if ($post->number == 1) {
$discussion->increment('votes');
}

Expand Down

0 comments on commit cfcca8b

Please sign in to comment.