fix new logic to calculator with required and optional subjects

This commit is contained in:
aslan 2024-03-18 11:56:03 +03:00
parent 75870ab2fd
commit 9fcd049173
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class CalculatorController extends Controller
}, true);
})
->filter(function ($subjectTypes) use ($calcultatorSubjects) {
if(array_key_exists(2, $subjectTypes)) {
if (array_key_exists(2, $subjectTypes)) {
$optionalSubjectsInCalculator = collect($subjectTypes[2])
->filter(fn($optionalSubject) => in_array($optionalSubject, $calcultatorSubjects));
return $optionalSubjectsInCalculator->count() !== 0;