Skip to content

Commit

Permalink
fix: when user likes a challenge, return status code is 200
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadmp97 committed Sep 8, 2023
1 parent e45dd92 commit 72d847f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ChallengeLikesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function store(Challenge $challenge, LikeChallengeAction $likeChallengeAc
{
$likeChallengeAction->execute(request()->user(), $challenge);

return $this->created();
return $this->ok();
}

public function destroy(Challenge $challenge, UnlikeChallengeAction $unlikeChallengeAction)
Expand Down
5 changes: 1 addition & 4 deletions tests/Feature/ChallengeLikesControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ public function test_user_gets_like_list()
public function test_user_likes_a_challenge()
{
$this->postJson('api/challenges/1/likes')
->assertCreated();

$this->postJson('api/challenges/1/likes')
->assertCreated();
->assertOk();

$this->assertEquals(1, Challenge::first()->likes()->count());
}
Expand Down

0 comments on commit 72d847f

Please sign in to comment.