Skip to content

Commit

Permalink
fix whotofolloe
Browse files Browse the repository at this point in the history
  • Loading branch information
fokosun committed Sep 10, 2023
1 parent 21c3c09 commit 11c3a47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Illuminate\Support\Facades\Mail;
use Symfony\Component\HttpFoundation\Response as ResponseAlias;
use Tymon\JWTAuth\Facades\JWTAuth;
use Tymon\JWTAuth\JWT;

class UserController extends Controller
{
Expand Down Expand Up @@ -119,11 +120,11 @@ public function followUser(Request $request)
* The logic to get who to follow is undecided yet
* For now, this just returns the latest five unfollowed users in the database
*/
public function getWhoToFollow()
public function getWhoToFollow(Request $request, JWT $jwtAuth)
{
/** @phpstan-ignore-next-line */
return ($user = JWTAuth::parseToken()->user()) ?
$this->getWhoToFollowData($user) :
return ($jwtAuth->parseToken()->check()) ?

Check failure on line 126 in app/Http/Controllers/UserController.php

View workflow job for this annotation

GitHub Actions / php-cs

No error to ignore is reported on line 126.
$this->getWhoToFollowData($request->user()) :
$this->unauthorizedResponse();
}

Expand Down
6 changes: 3 additions & 3 deletions app/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public function update(Request $request, string $option)
public function findWhere($q)
{
return User::with(['cookbooks', 'recipes'])
->where('id', $q)
->orWhere('email', $q)
->orWhere('name_slug', $q);
->where('id', '=', $q)
->orWhere('email', '=', $q)
->orWhere('name_slug', '=', $q);
}
}

0 comments on commit 11c3a47

Please sign in to comment.