From 2f6585f26fe5e6326ad3018f44a0237b0a13962e Mon Sep 17 00:00:00 2001 From: Rizki Date: Fri, 10 Apr 2026 14:35:54 +0700 Subject: [PATCH] upd --- adapter/justificationadapter.js | 4 +++- emailnotif.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/adapter/justificationadapter.js b/adapter/justificationadapter.js index 8abd80d..9579af4 100644 --- a/adapter/justificationadapter.js +++ b/adapter/justificationadapter.js @@ -390,7 +390,9 @@ class JustificationAdapter extends Adapter{ // apires.meta.message = "Record Not Found"; // } callback(null, apires); - emailNotif.notifyOnSubmit(idxjustification); + if (parseInt(status) !== -1) { + emailNotif.notifyOnSubmit(idxjustification); + } } }); } catch (err) { diff --git a/emailnotif.js b/emailnotif.js index 024d43e..ec7ff79 100644 --- a/emailnotif.js +++ b/emailnotif.js @@ -69,7 +69,7 @@ function notifyOnSubmit(idxjustification) { select t.nik, e.fullname from tbl_justificationttd t join dbssotcel.tbl_employee e on e.nik = t.nik - where t.idxjustification = '${idxjustification}' and t.category = 'APR' and t.issigned = 0 and t.isdeleted = 0 + where t.idxjustification = '${idxjustification}' and t.issigned = 0 and t.isdeleted = 0 order by t._idx asc limit 1 `; db.query(qryApprover, [], function(err2, rows2) {