fix(penilai/so): prbaikkan pindah penilai dan tambah filter role penilai
This commit is contained in:
@@ -73,7 +73,8 @@ class ActivityController extends Controller
|
||||
public function updateTeamAssingment(Request $request)
|
||||
{
|
||||
try {
|
||||
// Validasi input
|
||||
|
||||
// dd($request->all());
|
||||
$validatedData = $request->validate([
|
||||
'id' => 'required|integer', // penilaian_id
|
||||
'team_member_id' => 'nullable|integer',
|
||||
@@ -81,6 +82,7 @@ class ActivityController extends Controller
|
||||
'permohonan_id' => 'required|integer',
|
||||
'user_id' => 'required|integer',
|
||||
'team_id' => 'required|integer',
|
||||
'penugasan' => 'required|string',
|
||||
], [
|
||||
'team_member_id.required_without' => 'Field team harus diisi.',
|
||||
'.required_without' => 'Field harus diisi.',
|
||||
@@ -93,6 +95,7 @@ class ActivityController extends Controller
|
||||
$permohonanId = $validatedData['permohonan_id'];
|
||||
$userId = $validatedData['user_id'];
|
||||
$teamId = $validatedData['team_id'];
|
||||
$penugasan = $validatedData['penugasan'];
|
||||
|
||||
// Cek apakah permohonan ada
|
||||
$permohonan = Permohonan::findOrFail($permohonanId);
|
||||
@@ -106,55 +109,101 @@ class ActivityController extends Controller
|
||||
// }
|
||||
|
||||
// Ambil tim berdasarkan penilaian_id dan user_id
|
||||
$teams = PenilaianTeam::where('penilaian_id', $penilaianId)
|
||||
|
||||
if ($penugasan === 'sama') {
|
||||
$teams = PenilaianTeam::where('penilaian_id', $penilaianId)
|
||||
->where('user_id', $userId)
|
||||
->get();
|
||||
// Cek apakah tim ditemukan
|
||||
if ($teams->isEmpty()) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Data tim tidak ditemukan.',
|
||||
]);
|
||||
}
|
||||
|
||||
// Cek apakah tim ditemukan
|
||||
if ($teams->isEmpty()) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Data tim tidak ditemukan.',
|
||||
]);
|
||||
}
|
||||
// Mulai transaksi
|
||||
DB::beginTransaction();
|
||||
$updated = false;
|
||||
|
||||
// Mulai transaksi
|
||||
DB::beginTransaction();
|
||||
$updated = false;
|
||||
$status_permohonan = $permohonan->status;
|
||||
|
||||
// Proses update berdasarkan region_id
|
||||
if ($regionId) {
|
||||
foreach ($teams as $team) {
|
||||
if ($team->role === 'surveyor') {
|
||||
$team->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null]);
|
||||
$permohonan->update([
|
||||
'status' => 'registered']);
|
||||
$updated = true;
|
||||
// Proses update berdasarkan region_id
|
||||
if ($regionId) {
|
||||
foreach ($teams as $team) {
|
||||
if ($team->role === 'surveyor') {
|
||||
$team->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null,
|
||||
'status' => $status_permohonan,
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => 'reassign'
|
||||
]);
|
||||
$updated = true;
|
||||
}
|
||||
|
||||
if ($team->role === 'penilai') {
|
||||
$team->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null,
|
||||
'status' => $status_permohonan
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => 'reassign',
|
||||
'region_id' => $regionId,
|
||||
]);
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($team->role === 'penilai') {
|
||||
$team->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null,
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => 'registered',
|
||||
'region_id' => $regionId,
|
||||
]);
|
||||
$updated = true;
|
||||
// Proses update berdasarkan team_member_id
|
||||
if ($teamMemberId) {
|
||||
foreach ($teams as $team) {
|
||||
if ($team->role === 'surveyor' || $team->role === 'penilai') {
|
||||
$team->update(['user_id' => $teamMemberId]);
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Proses update berdasarkan team_member_id
|
||||
if ($teamMemberId) {
|
||||
foreach ($teams as $team) {
|
||||
if ($team->role === 'surveyor' || $team->role === 'penilai') {
|
||||
$team->update(['user_id' => $teamMemberId]);
|
||||
$updated = true;
|
||||
}
|
||||
if ($penugasan === 'surveyor' || $penugasan === 'penilai') {
|
||||
$teams = PenilaianTeam::where('penilaian_id', $penilaianId)
|
||||
->where('user_id', $userId)
|
||||
->where('role', $penugasan)
|
||||
->first();
|
||||
|
||||
// Cek apakah tim ditemukan
|
||||
if (!$teams) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Data tim tidak ditemukan.',
|
||||
]);
|
||||
}
|
||||
|
||||
// Mulai transaksi
|
||||
DB::beginTransaction();
|
||||
$updated = false;
|
||||
|
||||
// Proses update berdasarkan region_id
|
||||
if ($regionId) {
|
||||
$teams->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => $status_permohonan,
|
||||
'region_id' => $regionId,
|
||||
]);
|
||||
$updated = true;
|
||||
}
|
||||
|
||||
// Proses update berdasarkan team_member_id
|
||||
if ($teamMemberId) {
|
||||
$teams->update(['user_id' => $teamMemberId]);
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +355,7 @@ class ActivityController extends Controller
|
||||
}
|
||||
|
||||
// Filter for specific roles
|
||||
if (in_array($userRole, ['surveyor', 'surveyor-penilai'])) {
|
||||
if (in_array($userRole, ['surveyor', 'penilai'])) {
|
||||
$query->whereHas('penilaian.userPenilai', function ($q) use ($user) {
|
||||
$q->where('user_id', $user->id);
|
||||
});
|
||||
@@ -451,17 +500,17 @@ class ActivityController extends Controller
|
||||
|
||||
$hari = $hariPaparan = 0;
|
||||
|
||||
if($type_report == "sederhana"){
|
||||
if ($type_report == "sederhana") {
|
||||
$hari = 2;
|
||||
$item->paparan = 'Tidak Ada';
|
||||
} else{
|
||||
} else {
|
||||
if ($plafond == '< 2M') {
|
||||
$item->paparan = 'Tidak Ada';
|
||||
$hari = 3;
|
||||
}else if($plafond == '2 M - 5 M'){
|
||||
} elseif ($plafond == '2 M - 5 M') {
|
||||
$hari = 3;
|
||||
$hariPaparan = 2;
|
||||
}else {
|
||||
} else {
|
||||
$hari = 5;
|
||||
$hariPaparan = 3;
|
||||
}
|
||||
@@ -495,7 +544,7 @@ class ActivityController extends Controller
|
||||
if (!$tanggalMulai instanceof Carbon) {
|
||||
$tanggalMulai = Carbon::parse($tanggalMulai);
|
||||
}
|
||||
$hariKerjaBerikutnya = hitungHariKerja($tanggalMulai->toDateString(),$tanggalMulai->copy()->addDays(1));
|
||||
$hariKerjaBerikutnya = hitungHariKerja($tanggalMulai->toDateString(), $tanggalMulai->copy()->addDays(1));
|
||||
$hariKerjaBerikutnya = max($hariKerjaBerikutnya, 1);
|
||||
$tanggalMulai = $tanggalMulai->copy()->addDays($hariKerjaBerikutnya);
|
||||
|
||||
|
||||
@@ -576,7 +576,7 @@ class PenilaiController extends Controller
|
||||
if (!Auth::user()->hasRole('administrator')) {
|
||||
$query->whereHas('penilaian.userPenilai', function ($q) {
|
||||
$q
|
||||
->where('role', 'penilai')
|
||||
->where('role', ['surveyor','penilai'])
|
||||
->where('user_id', Auth::user()->id);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ class PenilaianController extends Controller
|
||||
$teamPenilai = $userTeam->flatMap(function ($team) {
|
||||
return $team->teamsUsers->filter(function ($teamUser) {
|
||||
return $teamUser->user->roles->contains(function ($role) {
|
||||
return $role->name === 'surveyor' || $role->name === 'surveyor-penilai' || $role->name === 'administrator';
|
||||
return $role->name === 'surveyor' || $role->name === 'penilai' || $role->name === 'administrator';
|
||||
});
|
||||
})->map(function ($teamUser) {
|
||||
return $teamUser->user;
|
||||
@@ -279,6 +279,8 @@ class PenilaianController extends Controller
|
||||
$penilaianTeam = PenilaianTeam::where('penilaian_id', $penilaian->id)->get();
|
||||
}
|
||||
|
||||
// dd($penilaianTeam);
|
||||
|
||||
return view(
|
||||
'lpj::penilaian.form',
|
||||
compact(
|
||||
@@ -347,8 +349,9 @@ class PenilaianController extends Controller
|
||||
|
||||
$query->whereIn('status', ['registered', 'registrasi-final', 'reassign']);
|
||||
|
||||
// Filter berdasarkan role
|
||||
|
||||
if (Auth::user()->roles[0]->name !== 'administrator') {
|
||||
|
||||
$query->whereHas('region.teams.teamsUsers.user', function ($q) {
|
||||
$q->where('id', Auth::user()->id);
|
||||
});
|
||||
@@ -376,7 +379,8 @@ class PenilaianController extends Controller
|
||||
|
||||
$filteredRecords = $query->count();
|
||||
$data = $query->with(
|
||||
['user', 'debiture', 'branch', 'tujuanPenilaian', 'jenisPenilaian', 'region.teams.teamsUsers.user'],
|
||||
['user', 'debiture', 'branch', 'tujuanPenilaian', 'jenisPenilaian', 'region.teams.teamsUsers.user',
|
||||
]
|
||||
)->get();
|
||||
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
@@ -738,8 +742,8 @@ class PenilaianController extends Controller
|
||||
'tujuanPenilaian',
|
||||
'nilaiPlafond',
|
||||
'penilaian.userPenilai' => function ($q) {
|
||||
$q->where('role', 'penilai')->with(['user', 'team.regions']);
|
||||
},
|
||||
$q->where('role', 'penilai')->with(['user', 'team.regions']);
|
||||
},
|
||||
'penilai',
|
||||
'approveSo',
|
||||
'approveEo',
|
||||
@@ -900,7 +904,7 @@ class PenilaianController extends Controller
|
||||
public function revisiLaporan(Request $request, $id)
|
||||
{
|
||||
// dd($id);
|
||||
if($request->dataHeader=='Paparan' || $request->dataHeader=='Freze SLA'){
|
||||
if ($request->dataHeader == 'Paparan' || $request->dataHeader == 'Freze SLA') {
|
||||
$authorization = Authorization::find($id);
|
||||
$permohonan = Permohonan::find($authorization->permohonan_id);
|
||||
} else {
|
||||
@@ -914,13 +918,13 @@ class PenilaianController extends Controller
|
||||
}
|
||||
|
||||
$status = 'revisi-paparan';
|
||||
}else if($permohonan->status === 'request-freeze'){
|
||||
} elseif ($permohonan->status === 'request-freeze') {
|
||||
if ($authorization) {
|
||||
$authorization->delete();
|
||||
}
|
||||
|
||||
$status = 'reject-freeze';
|
||||
}elseif ($permohonan->status === 'proses-laporan' && $userRole === 'EO Appraisal') {
|
||||
} elseif ($permohonan->status === 'proses-laporan' && $userRole === 'EO Appraisal') {
|
||||
$permohonan->update([
|
||||
'approval_so' => 0,
|
||||
'approval_so_at' => null,
|
||||
|
||||
@@ -2028,7 +2028,7 @@ class SurveyorController extends Controller
|
||||
if (!Auth::user()->hasRole('administrator')) {
|
||||
$query->whereHas('penilaian.userPenilai', function ($q) {
|
||||
$q->where('user_id', Auth::user()->id);
|
||||
$q->where('role', 'surveyor');
|
||||
$q->where('role', ['surveyor', 'penilai']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -292,10 +292,16 @@
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary" onclick="updateTeam(${data.user_penilai[0].penilaian_id}, ${data.permohonan.id}, ${data.user_penilai[0].user_id}, ${data.user_penilai[0].team_id})" title="Ganti Team">
|
||||
render: (item, data) => {
|
||||
const roles = data.user_penilai.map(d => d.role)
|
||||
let htmlData = ''
|
||||
|
||||
htmlData = `<a class="btn btn-sm btn-icon btn-clear btn-primary" onclick="updateTeam(${data.user_penilai[0].penilaian_id}, ${data.permohonan.id}, ${data.user_penilai[0].user_id}, ${data.user_penilai[0].team_id}, '${roles}')" title="Ganti Team">
|
||||
<i class="ki-filled ki-user-edit"></i>
|
||||
</a>`,
|
||||
</a>`
|
||||
|
||||
return htmlData;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -326,114 +332,181 @@
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function updateTeam(penilaaniId, permohonanId, userId, teamId) {
|
||||
const selectCategory = () => {
|
||||
function updateTeam(penilaaniId, permohonanId, userId, teamId, roles) {
|
||||
|
||||
|
||||
const selectCategory = () => {
|
||||
Swal.fire({
|
||||
title: 'Pilih Kategori',
|
||||
html: `
|
||||
<select id="categorySelect" class="input">
|
||||
<option value="" selected disabled>Pilih kategori Pengganti</option>
|
||||
<option value="team">Pilih dari Team</option>
|
||||
<option value="region">Pilih dari Wilayah</option>
|
||||
</select>
|
||||
`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Lanjut',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: () => {
|
||||
const selectedCategory = document.getElementById('categorySelect').value;
|
||||
if (!selectedCategory) {
|
||||
Swal.showValidationMessage('Anda harus memilih kategori!');
|
||||
}
|
||||
return selectedCategory;
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const selectedCategory = result.value;
|
||||
let subOptionsHtml = '';
|
||||
|
||||
if (selectedCategory === 'team') {
|
||||
if (roles === 'surveyor' || roles === 'penilai') {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input" disabled>
|
||||
<option value="${roles}" selected>${roles}</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
<option value="penilai">Penilai</option>
|
||||
<option value="sama">Penilai dan Surveyor Sama</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
} else if (selectedCategory === 'region') {
|
||||
if (roles === 'surveyor' || roles === 'penilai') {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input" disabled>
|
||||
<option value="${roles}" selected>${roles}</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div>
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
<option value="penilai">Penilai</option>
|
||||
<option value="sama">Penilai dan Surveyor Sama</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Wilayah</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->regions->id }}">{{ $item->regions->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: 'Pilih Kategori',
|
||||
input: 'select',
|
||||
inputOptions: {
|
||||
team: 'Pilih dari Team',
|
||||
region: 'Pilih dari Wilayah'
|
||||
},
|
||||
inputPlaceholder: 'Pilih kategori Pengganti',
|
||||
icon: 'warning',
|
||||
title: `Pilih ${selectedCategory === 'team' ? 'Anggota Tim' : 'Wilayah'}`,
|
||||
html: subOptionsHtml,
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Lanjut',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const selectedCategory = result.value;
|
||||
let subOptions = {};
|
||||
|
||||
if (selectedCategory === 'team') {
|
||||
subOptions = {
|
||||
@foreach ($teamsActivity as $item)
|
||||
{{ $item->user->id }}: '{{ $item->user->name }}',
|
||||
@endforeach
|
||||
};
|
||||
} else if (selectedCategory === 'region') {
|
||||
subOptions = {
|
||||
@foreach ($teamPenilai as $item)
|
||||
{{ $item->regions->id }}: '{{ $item->regions->name }}',
|
||||
@endforeach
|
||||
};
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Kembali',
|
||||
preConfirm: () => {
|
||||
const subOptionsPenugasan = document.getElementById('subOptionsPenugasan')?.value;
|
||||
const subSelected = document.getElementById('subOptionsSelect').value;
|
||||
if (!subSelected) {
|
||||
Swal.showValidationMessage('Anda harus memilih opsi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: 'Pilih ' + (selectedCategory === 'team' ? 'Anggota Tim' : 'Wilayah'),
|
||||
input: 'select',
|
||||
inputOptions: subOptions,
|
||||
inputPlaceholder: 'Pilih salah satu ' + (selectedCategory === 'team' ?
|
||||
'Anggota Tim' : 'Wilayah'),
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Kembali',
|
||||
}).then((subResult) => {
|
||||
if (subResult.dismiss === Swal.DismissReason.cancel) {
|
||||
// Kembali ke tahap pemilihan kategori
|
||||
selectCategory();
|
||||
} else if (subResult.isConfirmed) {
|
||||
if (!subResult.value) {
|
||||
Swal.fire('Error!', 'Anda harus memilih opsi sebelum melanjutkan.',
|
||||
'error');
|
||||
return;
|
||||
return {
|
||||
penugasan: subOptionsPenugasan || null,
|
||||
selectedOption: subSelected || null,
|
||||
};
|
||||
}
|
||||
}).then((subResult) => {
|
||||
|
||||
console.log(subResult);
|
||||
|
||||
if (subResult.dismiss === Swal.DismissReason.cancel) {
|
||||
selectCategory();
|
||||
} else if (subResult.isConfirmed) {
|
||||
if (!subResult.value) {
|
||||
Swal.fire('Error!', 'Anda harus memilih opsi sebelum melanjutkan.', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ URL::to('/activity/update-team') }}";
|
||||
const paramKey = selectedCategory === 'team' ? 'team_member_id' : 'region_id';
|
||||
|
||||
let input_data = {
|
||||
_token: token,
|
||||
id: penilaaniId,
|
||||
[paramKey]: subResult.value.selectedOption,
|
||||
penugasan: subResult.value.penugasan,
|
||||
permohonan_id: permohonanId,
|
||||
user_id: userId,
|
||||
team_id: teamId,
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses!', response.message, 'success').then(() => {
|
||||
location.reload(true);
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
|
||||
// Define variables
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ URL::to('/activity/update-team') }}";
|
||||
|
||||
// Tentukan tipe parameter berdasarkan kategori
|
||||
const paramKey = selectedCategory === 'team' ? 'team_member_id' :
|
||||
'region_id';
|
||||
|
||||
// Prepare input data
|
||||
let input_data = {
|
||||
_token: token,
|
||||
id: penilaaniId,
|
||||
[paramKey]: subResult.value,
|
||||
permohonan_id: permohonanId,
|
||||
user_id: userId,
|
||||
team_id: teamId,
|
||||
};
|
||||
|
||||
// AJAX request
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses!', response.message,
|
||||
'success').then(() => {
|
||||
location.reload(true);
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error(xhr);
|
||||
Swal.fire('Error!',
|
||||
'Terjadi kesalahan saat memproses permintaan.',
|
||||
'error');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error(xhr);
|
||||
Swal.fire('Error!', 'Terjadi kesalahan saat memproses permintaan.', 'error');
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
selectCategory();
|
||||
}
|
||||
|
||||
// Mulai dari pemilihan kategori
|
||||
selectCategory();
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user