fix: prevent duplicate homepage financing records and update API and login configuration
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Services\PembiayaanService;
|
||||
use App\Services\CustomerInfoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
@@ -31,16 +31,7 @@ class HomeController extends Controller
|
||||
$homeUrl = route('home');
|
||||
$authUser = Auth::user();
|
||||
|
||||
$responses = Http::pool(fn ($pool) => [
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
]);
|
||||
|
||||
$customer_pkb = $responses[0]->json();
|
||||
$customer_koop = $responses[1]->json();
|
||||
[$customer_pkb, $customer_koop] = CustomerInfoService::get($authUser['icno']);
|
||||
|
||||
$customerLelong = $this->getCustomerInfoLelong($authUser['icno']);
|
||||
|
||||
@@ -82,16 +73,7 @@ class HomeController extends Controller
|
||||
|
||||
$authUser = Auth::user();
|
||||
|
||||
$responses = Http::pool(fn ($pool) => [
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
]);
|
||||
|
||||
$customer_pkb = $responses[0]->json();
|
||||
$customer_koop = $responses[1]->json();
|
||||
[$customer_pkb, $customer_koop] = CustomerInfoService::get($authUser['icno']);
|
||||
|
||||
|
||||
$customerLelong = $this->getCustomerInfoLelong($authUser['icno']);
|
||||
@@ -124,13 +106,7 @@ class HomeController extends Controller
|
||||
}
|
||||
|
||||
private function getCustomerInfoLelong($icno){
|
||||
$customerLelong = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info/lelong', ['ic' => $icno])
|
||||
->json();
|
||||
|
||||
$customerLelongKoop = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info/lelong', ['ic' => $icno])
|
||||
->json();
|
||||
[$customerLelong, $customerLelongKoop] = CustomerInfoService::get($icno, '/portal/customer/info/lelong');
|
||||
|
||||
// Extract data with null safety
|
||||
$bakiLelong = isset($customerLelong['success']) && $customerLelong['success']
|
||||
|
||||
Reference in New Issue
Block a user