Merge branch 'staging' into feature/senior-officer
This commit is contained in:
@@ -171,7 +171,11 @@ class KJPPController extends Controller
|
||||
$validated['detail_nama_pic_marketing'] = $detailNamaPicMarketingJson;
|
||||
$validated['detail_nomor_hp_pic_marketing'] = $detailNomorHpPicMarketingJson;
|
||||
$validated['ijin_usaha_id'] = json_encode($validated['ijin_usaha_id']);
|
||||
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
||||
if (empty($validated['jenis_aset_id'])) {
|
||||
$validated['jenis_aset_id'] = json_encode([]);
|
||||
} else {
|
||||
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
||||
}
|
||||
// Tambahkan nama file ke data yang divalidasi
|
||||
$validated['attachment'] = $filename;
|
||||
|
||||
@@ -434,7 +438,11 @@ class KJPPController extends Controller
|
||||
$validated['detail_nama_pic_marketing'] = $detailNamaPicMarketingJson;
|
||||
$validated['detail_nomor_hp_pic_marketing'] = $detailNomorHpPicMarketingJson;
|
||||
$validated['ijin_usaha_id'] = json_encode($validated['ijin_usaha_id']);
|
||||
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
||||
if (empty($validated['jenis_aset_id'])) {
|
||||
$validated['jenis_aset_id'] = json_encode([]);
|
||||
} else {
|
||||
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
||||
}
|
||||
|
||||
// Perbarui data di database
|
||||
KJPP::where('id', $id)->update($validated);
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace Modules\Lpj\Http\Controllers;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\BasicDataSurveyorExport;
|
||||
@@ -527,22 +528,29 @@ class SurveyorController extends Controller
|
||||
|
||||
|
||||
|
||||
public function storeAproved($id)
|
||||
public function storeAproved(Request $request, $id): JsonResponse
|
||||
{
|
||||
try {
|
||||
$penilaian = Penilaian::findOrFail($id);
|
||||
$penilaian->update([
|
||||
'authorized_status' => 1,
|
||||
]);
|
||||
$data = [];
|
||||
if (request()->ajax()) {
|
||||
try {
|
||||
$penilaian = Penilaian::findOrFail($id);
|
||||
$penilaian->update([
|
||||
'authorized_status' => 1,
|
||||
]);
|
||||
|
||||
$data['status'] = 'success';
|
||||
$data['message']= 'Jadwal '.$request->noReg.' berhasil di aprove';
|
||||
} catch (\Exception $e) {
|
||||
$data['status'] = 'error';
|
||||
$data['message'] = 'Gagal membuat jadwal: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('permohonan.index')
|
||||
->with('success', 'Jadwal berhasil di aprove.');
|
||||
} catch (\Exception $e) {
|
||||
return redirect()
|
||||
->route('permohonan.index')
|
||||
->with('error', 'Gagal membuat jadwal: ' . $e->getMessage());
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['message'] = "no ajax request";
|
||||
}
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user