Modified loading questions on a section
This commit is contained in:
@@ -19,13 +19,11 @@ class SectionQuestionController extends Controller
|
||||
*/
|
||||
public function index($section)
|
||||
{
|
||||
$question = Section::find($section)
|
||||
->questions()->paginate(1);
|
||||
$questions = Section::find($section)
|
||||
->questions()
|
||||
->orderBy('number', 'asc')->get();
|
||||
|
||||
return $this->response
|
||||
->paginator($question, new QuestionTransformer, ['key' => 'questions']);
|
||||
|
||||
// return QuestionTransformer::collection($questions);
|
||||
return $this->response->collection($questions, new QuestionTransformer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user