zet-lib 1.5.25 → 1.5.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/zRoleRouter.js +1 -1
- package/lib/zRoute.js +28 -12
- package/package.json +1 -1
package/lib/zRoleRouter.js
CHANGED
|
@@ -102,7 +102,7 @@ router.post('/update/:id', async function (req, res, next) {
|
|
|
102
102
|
if (err) {
|
|
103
103
|
//console.log(err.toString());
|
|
104
104
|
}
|
|
105
|
-
pm2.
|
|
105
|
+
pm2.reload(process.env.PM2_NAME, (err, proc) => {
|
|
106
106
|
//io.to(room).emit("message","Restart done")
|
|
107
107
|
})
|
|
108
108
|
})
|
package/lib/zRoute.js
CHANGED
|
@@ -1152,19 +1152,35 @@ zRoute.dataTableFilter = (MYMODEL, relations, filter) => {
|
|
|
1152
1152
|
};
|
|
1153
1153
|
|
|
1154
1154
|
zRoute.approval_history_data = (arr = []) => {
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
arr.
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1155
|
+
try {
|
|
1156
|
+
let myvalue = "";
|
|
1157
|
+
let APPROVAL_LEVELS = myCache.get("APPROVAL_LEVELS");
|
|
1158
|
+
let USERS = Util.arrayToObject(myCache.get("zuser_created_by_1"), "id");
|
|
1159
|
+
myvalue = "";
|
|
1160
|
+
if (arr && arr.length > 0) {
|
|
1161
|
+
arr = arr.reverse();
|
|
1162
|
+
arr.map((item) => {
|
|
1163
|
+
let statusName = ' '
|
|
1164
|
+
if (item.status == 6) {
|
|
1165
|
+
statusName = "Comment"
|
|
1166
|
+
} else if (item.status == 4) {
|
|
1167
|
+
statusName = "Reject"
|
|
1168
|
+
} else if (item.status == 3) {
|
|
1169
|
+
statusName = "Approve"
|
|
1170
|
+
} else {
|
|
1171
|
+
statusName = APPROVAL_LEVELS[item.status] ? APPROVAL_LEVELS[item.status].name : ''
|
|
1172
|
+
}
|
|
1173
|
+
myvalue += `${statusName} By:${
|
|
1174
|
+
USERS[item.user_id].zname || ''
|
|
1175
|
+
} - (${item.time ? Util.dateFormat(item.time, "DD MMM YYYY HH:mm") : ''}) (${item.comments ? item.comments : item.text || ''}) <br>`;
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
return myvalue;
|
|
1179
|
+
} catch (e) {
|
|
1180
|
+
console.log(e)
|
|
1181
|
+
return '';
|
|
1165
1182
|
}
|
|
1166
|
-
|
|
1167
|
-
};
|
|
1183
|
+
}
|
|
1168
1184
|
|
|
1169
1185
|
zRoute.dataTableData = (
|
|
1170
1186
|
key,
|