Penggantian Nomor asli pmipinan
This commit is contained in:
@@ -32,7 +32,11 @@ class VerifikasiAbsenController extends Controller
|
||||
|
||||
public function show(Request $request, int $id): JsonResponse
|
||||
{
|
||||
$pengajuan = PengajuanPresensi::with(['pegawai', 'notes'])->findOrFail($id);
|
||||
$pengajuan = PengajuanPresensi::with(['pegawai', 'notes'])->find($id);
|
||||
|
||||
if (! $pengajuan) {
|
||||
return $this->responsePengajuanTidakDitemukan();
|
||||
}
|
||||
|
||||
$otorisasi = $this->otorisasiAtasan($request, $pengajuan);
|
||||
|
||||
@@ -54,7 +58,11 @@ class VerifikasiAbsenController extends Controller
|
||||
*/
|
||||
public function perbaruiSesi(Request $request, int $id): JsonResponse
|
||||
{
|
||||
$pengajuan = PengajuanPresensi::findOrFail($id);
|
||||
$pengajuan = PengajuanPresensi::find($id);
|
||||
|
||||
if (! $pengajuan) {
|
||||
return $this->responsePengajuanTidakDitemukan();
|
||||
}
|
||||
|
||||
if ($this->isExpired($pengajuan)) {
|
||||
return response()->json([
|
||||
@@ -87,7 +95,11 @@ class VerifikasiAbsenController extends Controller
|
||||
'passphrase' => 'required|string',
|
||||
]);
|
||||
|
||||
$pengajuan = PengajuanPresensi::with(['pegawai', 'notes'])->findOrFail($id);
|
||||
$pengajuan = PengajuanPresensi::with(['pegawai', 'notes'])->find($id);
|
||||
|
||||
if (! $pengajuan) {
|
||||
return $this->responsePengajuanTidakDitemukan();
|
||||
}
|
||||
|
||||
$otorisasi = $this->otorisasiAtasan($request, $pengajuan);
|
||||
|
||||
@@ -146,7 +158,11 @@ class VerifikasiAbsenController extends Controller
|
||||
'catatan' => 'required|string|max:500',
|
||||
]);
|
||||
|
||||
$pengajuan = PengajuanPresensi::with(['pegawai', 'notes'])->findOrFail($id);
|
||||
$pengajuan = PengajuanPresensi::with(['pegawai', 'notes'])->find($id);
|
||||
|
||||
if (! $pengajuan) {
|
||||
return $this->responsePengajuanTidakDitemukan();
|
||||
}
|
||||
|
||||
$otorisasi = $this->otorisasiAtasan($request, $pengajuan);
|
||||
|
||||
@@ -254,6 +270,15 @@ class VerifikasiAbsenController extends Controller
|
||||
return $hasil['nip'];
|
||||
}
|
||||
|
||||
private function responsePengajuanTidakDitemukan(): JsonResponse
|
||||
{
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'state' => 'not_found',
|
||||
'message' => 'Pengajuan ini sudah dihapus oleh pemohon atau tidak ditemukan lagi, sehingga tidak dapat diverifikasi.',
|
||||
], 404);
|
||||
}
|
||||
|
||||
private function responseTidakBerwenang(string $reason): JsonResponse
|
||||
{
|
||||
return match ($reason) {
|
||||
|
||||
Reference in New Issue
Block a user