fix teacher and parent routes

This commit is contained in:
root
2026-04-24 02:12:01 -04:00
parent 5128c74892
commit 7216cb2885
36 changed files with 1575 additions and 49 deletions
@@ -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']