fix teacher and parent routes
This commit is contained in:
@@ -43,7 +43,23 @@ class SchoolCalendarController extends BaseApiController
|
||||
|
||||
public function index(SchoolCalendarIndexRequest $request): JsonResponse
|
||||
{
|
||||
$filters = $request->validated();
|
||||
return $this->respondWithEvents($request->validated());
|
||||
}
|
||||
|
||||
/**
|
||||
* Legacy teacher portal URL: same response as
|
||||
* GET /api/v1/settings/school-calendar/events?audience=teacher
|
||||
*/
|
||||
public function teacherCalendarLegacy(SchoolCalendarIndexRequest $request): JsonResponse
|
||||
{
|
||||
return $this->respondWithEvents([
|
||||
...$request->validated(),
|
||||
'audience' => 'teacher',
|
||||
]);
|
||||
}
|
||||
|
||||
private function respondWithEvents(array $filters): JsonResponse
|
||||
{
|
||||
$audience = $filters['audience'] ?? null;
|
||||
$includeMeetings = array_key_exists('include_meetings', $filters)
|
||||
? (bool) $filters['include_meetings']
|
||||
|
||||
Reference in New Issue
Block a user