Move maintenance code to maintenance-socket-handler.js

This commit is contained in:
Louis Lam
2022-09-17 16:58:08 +08:00
parent 7017c2e625
commit 120e578398
2 changed files with 27 additions and 27 deletions

View File

@@ -767,30 +767,6 @@ let needSetup = false;
}
});
socket.on("getMaintenance", async (maintenanceID, callback) => {
try {
checkLogin(socket);
console.log(`Get Maintenance: ${maintenanceID} User ID: ${socket.userID}`);
let bean = await R.findOne("maintenance", " id = ? AND user_id = ? ", [
maintenanceID,
socket.userID,
]);
callback({
ok: true,
maintenance: await bean.toJSON(),
});
} catch (e) {
callback({
ok: false,
msg: e.message,
});
}
});
socket.on("getMonitorBeats", async (monitorID, period, callback) => {
try {
checkLogin(socket);