|
|
@@ -34,16 +34,16 @@ exports.pengajuan = handleError(async (req, res) => {
|
|
|
})
|
|
|
|
|
|
exports.dokumen = handleError(async (req, res) => {
|
|
|
- // const dokumen = await dokumenModel.find({ path: /api.sidali.sixsenz.net/ })
|
|
|
+ const dokumen = await dokumenModel.find()
|
|
|
|
|
|
- // if (dokumen?.length) await Promise.all(dokumen.map(async e => {
|
|
|
+ if (dokumen?.length) await Promise.all(dokumen.map(async e => {
|
|
|
const path = e.path.split('/').slice(3).join('/')
|
|
|
await dokumenModel.findOneAndUpdate({
|
|
|
_id: e._id
|
|
|
}, {
|
|
|
path: `${coba.decrypt(process.env.W8A1C)}/${path}`
|
|
|
})
|
|
|
- // }))
|
|
|
+ }))
|
|
|
|
|
|
return response.success(res, {
|
|
|
message: 'Berhasil migrasi dokumen'
|