|
|
@@ -99,7 +99,6 @@ exports.create = handleError(async (req, res) => {
|
|
|
sanksi: data._id,
|
|
|
$push: { step: from_date ? SANKSI : SELESAI },
|
|
|
flag: from_date ? SANKSI : SELESAI
|
|
|
- // aktif: false,
|
|
|
})
|
|
|
await pemantauanModel.create({
|
|
|
laporan: laporan._id,
|
|
|
@@ -191,10 +190,8 @@ exports.update = handleError(async (req, res) => {
|
|
|
sanksi: sanksiBody,
|
|
|
keterangan,
|
|
|
dokumen: dokumen_id,
|
|
|
- masa_berlaku: {
|
|
|
- from_date,
|
|
|
- to_date
|
|
|
- },
|
|
|
+ aktif: from_date ? true : false,
|
|
|
+ masa_berlaku: from_date && to_date ? { from_date, to_date } : null,
|
|
|
$push: {
|
|
|
riwayat_sanksi: sanksi
|
|
|
}
|
|
|
@@ -368,12 +365,7 @@ exports.getAll = handleError(async (req, res) => {
|
|
|
}
|
|
|
}
|
|
|
if (perbaikan === TRUE) {
|
|
|
- where.$or = [{
|
|
|
- 'jawaban.banding': {
|
|
|
- $exists: true,
|
|
|
- $ne: null
|
|
|
- }
|
|
|
- }, { is_pengajuan_keberatan: false }, { is_pengajuan_banding: false }]
|
|
|
+ where.perbaikan = { $exists: true, $ne: [] }
|
|
|
}
|
|
|
if (delegasi === TRUE) {
|
|
|
where.delegasi = true
|