Prechádzať zdrojové kódy

fix, dikti bisa liat semua laporan yg dibuat oleh lldikti

yazid 3 rokov pred
rodič
commit
a9a70dce40
1 zmenil súbory, kde vykonal 8 pridanie a 4 odobranie
  1. 8 4
      utils/cekData.js

+ 8 - 4
utils/cekData.js

@@ -13,11 +13,12 @@ exports.cekSatuDataLaporan = async (
   switch (user.role.id) {
     case 2020:
       if (where.all) {
-        w.role_asal = 'dikti'
+        // w.role_asal = 'dikti'
         // w['$or'] = [
         //   { role_asal : 'dikti' },
         //   { role_asal: 'lldikti', role_data: 'dikti' },
         // ]
+        break
       } else if (!where.delegasi) {
         w.role_data = 'dikti'
       } else {
@@ -64,11 +65,12 @@ exports.cekBanyakDataLaporan = async (user, where = { delegasi: false }) => {
   switch (user.role.id) {
     case 2020:
       if (where.all) {
-        w.role_asal = 'dikti'
+        // w.role_asal = 'dikti'
         // w['$or'] = [
         //   { role_asal : 'dikti' },
         //   { role_asal: 'lldikti', role_data: 'dikti' },
         // ]
+        break
       } else if (!where.delegasi) {
         w.role_data = 'dikti'
       } else {
@@ -113,7 +115,8 @@ exports.cekSatuDataSanksi = async (
   const w = { aktif: where.aktif || true }
   switch (user.role.id) {
     case 2020:
-      if (where.all) w.role_asal = 'dikti'
+      // if (where.all) w.role_asal = 'dikti'
+      if (where.all) break
       else if (!where.banding) w.role_data = 'dikti'
       break
     case 2021:
@@ -155,7 +158,8 @@ exports.cekBanyakDataSanksi = async (user, where = {}, q = {}) => {
   const w = { ...q }
   switch (user.role.id) {
     case 2020:
-      if (where.all) w.role_asal = 'dikti'
+      // if (where.all) w.role_asal = 'dikti'
+      if (where.all) break
       else if (!where.banding) w.role_data = 'dikti'
       break
     case 2021: