Commit 6b7939a6 by novanbagus

update email dosen

parent 86ed1358
...@@ -33,10 +33,31 @@ class BiodataRepository ...@@ -33,10 +33,31 @@ class BiodataRepository
$apiRequest = $client->request('GET', 'https://i-sdm.unesa.ac.id/biodataumum/'.trim($auth[0]->userid)); $apiRequest = $client->request('GET', 'https://i-sdm.unesa.ac.id/biodataumum/'.trim($auth[0]->userid));
$isdm = json_decode($apiRequest->getBody()->getContents()); $isdm = json_decode($apiRequest->getBody()->getContents());
if($isdm[0]->email == null || $isdm[0]->email == '')
{
$url = "https://i-sdm.unesa.ac.id/api/email/update/";
$token = '964cXM2eJmJVGLsj8x3M6gMi9kislGgobrbmzo6880m1mRRc9CLdW9v3Fh7VaLM0';
$headers = [
"Authorization" => "Bearer " . $token,
"Accept" => "application/json",
];
$api_call = $client->request('POST', $url,[
'headers' => $headers,
'form_params' => [
'nip' => $isdm[0]->nip,
'email' => $auth[0]->email
]
]);
$call_data = json_decode($api_call->getBody()->getContents());
}
// ubah novan karena ambil email dari isdm saja jangan dari auth; // ubah novan karena ambil email dari isdm saja jangan dari auth;
// $data['email'] = $auth[0]->email; // $data['email'] = $auth[0]->email;
// $data['noid'] = $isdm[0]->nip; // $data['noid'] = $isdm[0]->nip;
$data['email'] = $isdm[0]->email; $data['email'] = $auth[0]->email;
$data['name'] = $isdm[0]->nama; $data['name'] = $isdm[0]->nama;
$data['noid'] = $isdm[0]->nidn; $data['noid'] = $isdm[0]->nidn;
if ($isdm[0]->isdosen == 0) { if ($isdm[0]->isdosen == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment