Added clear all db statistics function

This commit is contained in:
Ponkhy 2021-09-01 00:36:24 +02:00
parent 1341d220ed
commit 7b92166d18
6 changed files with 48 additions and 8 deletions

View file

@ -566,7 +566,6 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString();
callback({
ok: true,
msg: "Events Successfully Cleared.",
});
} catch (e) {
@ -589,7 +588,26 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString();
callback({
ok: true,
msg: "Heartbeats Successfully Cleared.",
});
} catch (e) {
callback({
ok: false,
msg: e.message,
});
}
});
socket.on("clearStatistics", async (callback) => {
try {
checkLogin(socket)
console.log(`Clear Statistics User ID: ${socket.userID}`)
await R.exec("DELETE FROM heartbeat");
callback({
ok: true,
});
} catch (e) {