فهرست منبع

commit aja dah

yazid138 3 سال پیش
والد
کامیت
2e3369e158
1فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 8 4
      controller/sanksi.controller.js

+ 8 - 4
controller/sanksi.controller.js

@@ -107,7 +107,8 @@ exports.getAll = handleError(async (req, res) => {
     if (jawaban === 'true') {
       where['jawaban.keberatan'] = { $exists: true, $ne: null }
     }
-  } else if (banding === 'true') {
+  }
+  if (banding === 'true') {
     where.banding = true
     where['pengajuan.keberatan'] = { $exists: true, $ne: null }
     where['jawaban.keberatan'] = { $exists: true, $ne: null }
@@ -115,15 +116,18 @@ exports.getAll = handleError(async (req, res) => {
     if (jawaban === 'true') {
       where['jawaban.banding'] = { $exists: true, $ne: null }
     }
-  } else if (cabutSanksi === 'true') {
+  }
+  if (cabutSanksi === 'true') {
     where.perbaikan = { $exists: true, $ne: [] }
     if (jawaban === 'true') {
       where['pengajuan.cabut_sanksi'] = { $exists: true, $ne: null }
       // where['jawaban.cabut_sanksi'] = { $exists: true, $ne: null }
     }
-  } else if (perbaikan === 'true') {
+  }
+  if (perbaikan === 'true') {
     where['jawaban.banding'] = { $exists: true, $ne: null }
-  } else if (delegasi === 'true') {
+  }
+  if (delegasi === 'true') {
     where.delegasi = true
   }
   const data = await cekBanyakDataSanksi(user, where)