Skip to content

Commit

Permalink
Update VoteService.php
Browse files Browse the repository at this point in the history
  • Loading branch information
iooe committed Apr 28, 2019
1 parent 8b0a6b4 commit f9c15f7
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/UseCases/VoteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ public function make($user, Comment $comment, int $vote): void

if ($oldVoteEntity) {
$offset = $this->offset($oldVoteEntity->commenter_vote, $vote);
}

if ($oldVoteEntity && $offset) {
$this->remove($oldVoteEntity);
}
if ($oldVoteEntity && $offset) {
$this->remove($oldVoteEntity);
}

if ($oldVoteEntity && !$offset) {
$this->update($oldVoteEntity, $vote);
}
if ($oldVoteEntity && !$offset) {
$this->update($oldVoteEntity, $vote);
}

if (!$oldVoteEntity) {
} else {
$this->store($comment, $user, $vote);
}

Expand Down

0 comments on commit f9c15f7

Please sign in to comment.