security fix and fix parent pages
API CI/CD / Validate (composer + pint) (push) Successful in 3m7s
API CI/CD / Test (PHPUnit) (push) Failing after 5m46s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped

This commit is contained in:
root
2026-07-06 02:14:16 -04:00
parent 39228168c8
commit 90f9857b06
43 changed files with 4323 additions and 132 deletions
@@ -28,7 +28,7 @@ class FamilyAdminController extends BaseApiController
public function index(FamilyAdminIndexRequest $request): JsonResponse
{
$payload = $request->validated();
$schoolYear = trim((string) (Configuration::getConfig('school_year') ?? ''));
$schoolYear = $this->requestedSchoolYear($request, $payload);
$data = $this->queryService->adminIndexData(
$payload['student_id'] ?? null,
@@ -63,7 +63,7 @@ class FamilyAdminController extends BaseApiController
public function card(FamilyAdminCardRequest $request): JsonResponse
{
$payload = $request->validated();
$schoolYear = trim((string) (Configuration::getConfig('school_year') ?? ''));
$schoolYear = $this->requestedSchoolYear($request, $payload);
$family = $this->queryService->familyCard(
$payload['student_id'] ?? null,
@@ -79,6 +79,26 @@ class FamilyAdminController extends BaseApiController
return $this->success(new FamilyResource($family));
}
private function requestedSchoolYear($request, array $payload): string
{
$candidates = [
$payload['school_year'] ?? null,
$request->query('school_year'),
$request->header('X-School-Year'),
$request->header('X-Selected-School-Year'),
Configuration::getConfig('school_year'),
];
foreach ($candidates as $candidate) {
$value = trim((string) ($candidate ?? ''));
if ($value !== '') {
return $value;
}
}
return '';
}
public function composeEmail(FamilyComposeEmailRequest $request): JsonResponse
{
$payload = $request->validated();