update post guid scan admin

main
“ebik” 2025-08-12 10:46:53 +07:00
parent 86647ef04e
commit e4fbd77c5c
1 changed files with 13 additions and 13 deletions

View File

@ -680,19 +680,19 @@
const resp = await this.postGuid(guid);
console.debug('process response', resp);
if (resp && resp.success) {
const now = new Date();
const tanggal = now.toLocaleDateString('id-ID', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
const waktu = now.toLocaleTimeString('id-ID', { hour: '2-digit', minute: '2-digit' });
this.showSuccessModal(this.originalSpjCode, tanggal, waktu);
} else {
const errorMessage = (resp && resp.message) ? resp.message : 'Kode SPJ tidak ditemukan dalam database.';
if (errorMessage.toLowerCase().includes('sudah pernah di scan')) {
this.showAlreadyScannedModal(this.originalSpjCode);
} else {
this.showModal('error', 'SPJ Tidak Ditemukan', errorMessage, true);
}
}
if (resp.data.status === "valid") {
console.log();
const now = new Date();
const tanggal = now.toLocaleDateString('id-ID', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
const waktu = now.toLocaleTimeString('id-ID', { hour: '2-digit', minute: '2-digit' });
this.showSuccessModal(trimmed, tanggal, waktu);
}
else if (resp.data.status === "exits") {
this.showModal('error', 'SPJ sudah di Scan', (resp && resp.message) ? resp.message : 'Kode SPJ sudah digunakan.', true);
}else
{
this.showModal('error', 'SPJ Tidak Ditemukan', (resp && resp.message) ? resp.message : 'Kode SPJ tidak ditemukan dalam database.', true);
}
} catch (xhrOrErr) {
let message = '';
if (xhrOrErr && xhrOrErr.responseJSON) {