|
|
@@ -7,10 +7,9 @@ exports.cekSatuDataLaporan = async (
|
|
|
res,
|
|
|
user,
|
|
|
laporan_id,
|
|
|
- where = { delegasi: false }
|
|
|
+ where = { delegasi: false, aktif: true }
|
|
|
) => {
|
|
|
- const w = { _id: laporan_id, aktif: true, ...where }
|
|
|
- if (where.aktif === false) w.aktif = false
|
|
|
+ const w = { _id: laporan_id, aktif: where.aktif || true, ...where }
|
|
|
switch (user.role.id) {
|
|
|
case 2020:
|
|
|
if (!where.delegasi) w.role_data = 'dikti'
|
|
|
@@ -50,8 +49,7 @@ exports.cekSatuDataLaporan = async (
|
|
|
}
|
|
|
|
|
|
exports.cekBanyakDataLaporan = async (user, where = { delegasi: false }) => {
|
|
|
- const w = { aktif: true, ...where }
|
|
|
- if (where.aktif === false) w.aktif = false
|
|
|
+ const w = { aktif: where.aktif || true, ...where }
|
|
|
switch (user.role.id) {
|
|
|
case 2020:
|
|
|
if (!where.delegasi) w.role_data = 'dikti'
|
|
|
@@ -91,7 +89,7 @@ exports.cekSatuDataSanksi = async (
|
|
|
sanksi_id,
|
|
|
where = { banding: false }
|
|
|
) => {
|
|
|
- const w = { aktif: true }
|
|
|
+ const w = { aktif: where.aktif || true }
|
|
|
switch (user.role.id) {
|
|
|
case 2020:
|
|
|
if (!where.banding) w.role_data = 'dikti'
|
|
|
@@ -132,8 +130,11 @@ exports.cekSatuDataSanksi = async (
|
|
|
return sanksi
|
|
|
}
|
|
|
|
|
|
-exports.cekBanyakDataSanksi = async (user, where = { banding: false }) => {
|
|
|
- const w = { aktif: true }
|
|
|
+exports.cekBanyakDataSanksi = async (
|
|
|
+ user,
|
|
|
+ where = { banding: false, aktif: true }
|
|
|
+) => {
|
|
|
+ const w = { aktif: where.aktif || true }
|
|
|
switch (user.role.id) {
|
|
|
case 2020:
|
|
|
if (!where.banding) {
|