yazid138 2 роки тому
батько
коміт
69688f74e7

+ 2 - 2
controller/laporan.controller.js

@@ -71,7 +71,7 @@ exports.create = handleError(async (req, res) => {
   let contacts = await kontakModel.find()
   contacts = contacts.map((e) => e.nama).join(', ')
   try {
-    await notifWA(TEMPLATE_LAPORAN, [
+    const notif = await notifWA(TEMPLATE_LAPORAN, [
       {
         key: '1',
         value: 'nama',
@@ -286,7 +286,7 @@ exports.public = handleError(async (req, res) => {
   let contacts = await kontakModel.find()
   contacts = contacts.map((e) => e.nama).join(', ')
   try {
-    await notifWA(TEMPLATE_LAPORAN, [
+    const notif = await notifWA(TEMPLATE_LAPORAN, [
       {
         key: '1',
         value: 'nama',

+ 3 - 2
controller/sanksi.controller.js

@@ -334,7 +334,7 @@ exports.getOne = handleError(async (req, res) => {
 exports.editTmt = handleError(async (req, res) => {
   const user = req.user
   const { id } = req.params
-  const { from_date, to_date } = req.body
+  const { from_date, to_date, no_surat } = req.body
   const files = req.files
 
   const sanksi = await cekSatuDataSanksi(res, user, id)
@@ -343,6 +343,7 @@ exports.editTmt = handleError(async (req, res) => {
   const isValid = validate(res, req.body, {
     from_date: { type: 'date', convert: true },
     to_date: { type: 'date', convert: true },
+    no_surat: 'string',
   })
   if (!isValid) return
 
@@ -360,7 +361,7 @@ exports.editTmt = handleError(async (req, res) => {
       from_date,
       to_date,
     },
-    'pengajuan.update_tmt': { dokumen: dokumen_id },
+    'pengajuan.update_tmt': { no_surat, dokumen: dokumen_id },
   })
 
   await pemantauanModel.create({

+ 1 - 1
controller/sanksi/banding.controller.js

@@ -59,7 +59,7 @@ exports.create = handleError(async (req, res) => {
   let contacts = await kontakModel.find()
   contacts = contacts.map((e) => e.nama).join(', ')
   try {
-    await notifWA(TEMPLATE_BANDING, [
+    const notif = await notifWA(TEMPLATE_BANDING, [
       { key: '1', value: 'pt', value_text: sanksi.laporan.pt.nama },
       {
         key: '2',

+ 1 - 1
controller/sanksi/keberatan.controller.js

@@ -65,7 +65,7 @@ exports.create = handleError(async (req, res) => {
   let contacts = await kontakModel.find()
   contacts = contacts.map((e) => e.nama).join(', ')
   try {
-    await notifWA(TEMPLATE_KEBERATAN, [
+    const notif = await notifWA(TEMPLATE_KEBERATAN, [
       { key: '1', value: 'pt', value_text: sanksi.laporan.pt.nama },
       {
         key: '2',

+ 1 - 0
model/sanksi.model.js

@@ -138,6 +138,7 @@ module.exports = mongoose.model(
         ),
         update_tmt: new Schema(
           {
+            no_surat: String,
             dokumen: [
               {
                 type: Types.ObjectId,

+ 1 - 0
model/sanksi2.model.js

@@ -136,6 +136,7 @@ module.exports = mongoose.model(
         ),
         update_tmt: new Schema(
           {
+            no_surat: String,
             dokumen: [
               {
                 type: Types.ObjectId,