Handle erors on marhun service, and pembiayaan service
This commit is contained in:
@@ -23,7 +23,8 @@ class MarhunService
|
||||
});
|
||||
};
|
||||
|
||||
$marhunDetailsResponse = array_map(fn($x) => array_merge([], ...$x->json()), $getMarhunDetails());
|
||||
$marhunDetailsResponse = array_map(fn($x) => $x->json() == null ? [] : $x->Json(), $getMarhunDetails());
|
||||
$marhunDetailsResponse = array_map(fn($x) => array_merge([], ...$x), $marhunDetailsResponse);
|
||||
|
||||
$formatMarhunDetailData = function ($x) {
|
||||
$getMarhunTypeFullName = function ($code) {
|
||||
|
||||
@@ -165,9 +165,18 @@ class PembiayaanService
|
||||
};
|
||||
|
||||
$pembiayaanAkanDilelong = array_filter($getPembiayaanAkanDilelong(), $isCurrentDateGreaterThanEqual3DaysBeforeLelong);
|
||||
|
||||
$norujukanAkanDilelong = array_map(fn($x) => $x->norujukan, $pembiayaanAkanDilelong);
|
||||
|
||||
$pembiayaanInFasa2 = array_filter($getPembiayaanAkanDilelong(), fn($x) => $x->fasa == 2);
|
||||
$setDefaultFasaIfNotAvailable = function($x){
|
||||
if(! isset($x->fasa)){
|
||||
$x->fasa = 1;
|
||||
}
|
||||
return $x;
|
||||
};
|
||||
|
||||
$pembiayaanWithFasa = array_map($setDefaultFasaIfNotAvailable, $getPembiayaanAkanDilelong());
|
||||
$pembiayaanInFasa2 = array_filter($pembiayaanWithFasa, fn($x) => $x->fasa == 2);
|
||||
$norujukanInFasa2 = array_map(fn($x) => $x->norujukan, $pembiayaanInFasa2);
|
||||
|
||||
$getPayableUjrahBranches = fn() => Http::arrahn()->get('/api/payable-ujrah-branches')->json();
|
||||
|
||||
Reference in New Issue
Block a user