Add operation to allow newly poskod to registred through the API
This commit is contained in:
@@ -173,6 +173,17 @@ class CustomersController extends Controller
|
||||
$no_pelanggan = $request->bangsa . substr($request->noic,6,2).'-'.$count;
|
||||
$detail_poskod = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/poskod/' . $request->poskod)->json();
|
||||
|
||||
if(empty($detail_poskod)){
|
||||
|
||||
$detail_poskod = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->post(config('api.url') . '/api/poskod', [
|
||||
'poskod' => $request->poskod,
|
||||
'koddaerah' => $request->koddaerah,
|
||||
'kodnegeri' => $request->kodnegeri,
|
||||
])->json();
|
||||
|
||||
}
|
||||
|
||||
$customer_info = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/customers/create/'. $auth_user['cawangan'],[
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
'nopelanggan' => $no_pelanggan,
|
||||
|
||||
Reference in New Issue
Block a user