Skip to content

Commit b3968aa

Browse files
committed
Solve bugs
1 parent 92adcc1 commit b3968aa

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

app/GraphQL/Queries/UserFavoriteAuthors.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class UserFavoriteAuthors
1414
*/
1515
public function __invoke($_, array $args)
1616
{
17-
$bookIds = DB::table('favorites')->select(['book_id'])->where('user_id', '=', Auth::id());
17+
$bookIds = DB::table('favorites')->select(['book_id'])->where('user_id', '=', Auth::id())->get();
1818
$authorIds = DB::table('books')->select(['author_id'])->whereIn('id', $bookIds)->get();
1919
return Author::whereIn('id', $authorIds)->get();
2020
}

app/GraphQL/Queries/UserFavoriteBooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class UserFavoriteBooks
1414
*/
1515
public function __invoke($_, array $args)
1616
{
17-
$bookIds = DB::table('favorites')->select(['book_id'])->where('user_id', '=', Auth::id());
17+
$bookIds = DB::table('favorites')->select(['book_id'])->where('user_id', '=', Auth::id())->get();
1818
return Book::whereIn('id', $bookIds)->get();
1919
}
2020
}

app/GraphQL/Queries/UserFavoriteBooksByCategory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class UserFavoriteBooksByCategory
1414
*/
1515
public function __invoke($_, array $args)
1616
{
17-
$bookIds = DB::table('favorites')->select(['book_id'])->where('user_id', '=', Auth::id());
17+
$bookIds = DB::table('favorites')->select(['book_id'])->where('user_id', '=', Auth::id())->get();
1818
return Book::whereIn('id', $bookIds)->where('category_id', $args['categoryId'])->get();
1919
}
2020
}

app/GraphQL/Queries/UserFavoriteCategories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class UserFavoriteCategories
1414
*/
1515
public function __invoke($_, array $args)
1616
{
17-
$bookIds = DB::table('favorites')->select(['book_id'])->where('user_id', '=', Auth::id());
17+
$bookIds = DB::table('favorites')->select(['book_id'])->where('user_id', '=', Auth::id())->get();
1818
$categoryIds = DB::table('books')->select(['category_id'])->whereIn('id', $bookIds)->get();
1919
return Category::whereIn('id', $categoryIds)->get();
2020
}

0 commit comments

Comments
 (0)