You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Api/DeckController: don't return sessions by other users
With 0af425c the `index` method was
changed to include sessions **of the current user** in the response if
all decks for a module get queried. But the added statement
```
...->with(['sessions') => function (...) {...}])->with('sessions.answerChoices')->...
```
actually doesn't work as intended, as the second `with` statement loads
all sessions and not only those for the subset of the first `with`
selection. Instead, the right approach seems to be to add the with
statement to the sessions subquery:
```
$query->where('user_id', '=', Auth::id())->with('answerChoices');
```
0 commit comments