tests fix
API CI/CD / Validate (composer + pint) (push) Successful in 2m51s
API CI/CD / Test (PHPUnit) (push) Failing after 3m6s
API CI/CD / Build frontend assets (push) Failing after 5m23s
API CI/CD / Security audit (push) Failing after 34s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped

This commit is contained in:
root
2026-06-25 21:41:19 -04:00
parent 8661615717
commit 2ad6e9cf02
9 changed files with 95 additions and 24 deletions
@@ -35,6 +35,7 @@ use App\Services\Grading\GradingPlacementService;
use App\Services\Grading\GradingRefreshService;
use App\Services\Grading\GradingScoreService;
use Illuminate\Http\JsonResponse;
use RuntimeException;
class GradingController extends BaseApiController
{
@@ -143,11 +144,18 @@ class GradingController extends BaseApiController
public function refresh(GradingRefreshRequest $request): JsonResponse
{
$payload = $request->validated();
$this->refreshService->refreshSemesterScores(
(int) $payload['class_section_id'],
(string) $payload['semester'],
(string) $payload['school_year']
);
try {
$this->refreshService->refreshSemesterScores(
(int) $payload['class_section_id'],
(string) $payload['semester'],
(string) $payload['school_year']
);
} catch (RuntimeException $exception) {
return response()->json([
'ok' => false,
'message' => $exception->getMessage(),
], 422);
}
return response()->json(['ok' => true]);
}