fix new logic to calculator with required and optional subjects
This commit is contained in:
parent
75870ab2fd
commit
9fcd049173
|
@ -45,7 +45,7 @@ class CalculatorController extends Controller
|
||||||
}, true);
|
}, true);
|
||||||
})
|
})
|
||||||
->filter(function ($subjectTypes) use ($calcultatorSubjects) {
|
->filter(function ($subjectTypes) use ($calcultatorSubjects) {
|
||||||
if(array_key_exists(2, $subjectTypes)) {
|
if (array_key_exists(2, $subjectTypes)) {
|
||||||
$optionalSubjectsInCalculator = collect($subjectTypes[2])
|
$optionalSubjectsInCalculator = collect($subjectTypes[2])
|
||||||
->filter(fn($optionalSubject) => in_array($optionalSubject, $calcultatorSubjects));
|
->filter(fn($optionalSubject) => in_array($optionalSubject, $calcultatorSubjects));
|
||||||
return $optionalSubjectsInCalculator->count() !== 0;
|
return $optionalSubjectsInCalculator->count() !== 0;
|
||||||
|
|
Loading…
Reference in New Issue