fix parent pages and teachers and admin
API CI/CD / Validate (composer + pint) (push) Successful in 3m8s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Test (PHPUnit) (push) Failing after 6m5s
API CI/CD / Security audit (push) Failing after 52s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 3m8s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Test (PHPUnit) (push) Failing after 6m5s
API CI/CD / Security audit (push) Failing after 52s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -47,6 +47,8 @@ class TeacherController extends BaseApiController
|
||||
$studentsBySection[(string) $sectionId] = TeacherStudentResource::collection($students);
|
||||
}
|
||||
|
||||
$this->storeActiveClassInSession($data);
|
||||
|
||||
return response()->json([
|
||||
'ok' => true,
|
||||
'teacher' => $teacher,
|
||||
@@ -91,6 +93,8 @@ class TeacherController extends BaseApiController
|
||||
], 422);
|
||||
}
|
||||
|
||||
$this->storeActiveClassInSession($data);
|
||||
|
||||
return response()->json([
|
||||
'ok' => true,
|
||||
'active_class_section_id' => $requested,
|
||||
@@ -162,4 +166,18 @@ class TeacherController extends BaseApiController
|
||||
|
||||
return $userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function storeActiveClassInSession(array $data): void
|
||||
{
|
||||
$classSectionId = (int) ($data['active_class_section_id'] ?? 0);
|
||||
if ($classSectionId <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
session()->put('class_section_id', $classSectionId);
|
||||
session()->put('class_section_name', $data['class_section_name'] ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user