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