fix
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
Lee 2023-10-27 15:56:42 +01:00
parent 8f78bffc46
commit be7d32f7f2
2 changed files with 4 additions and 4 deletions

View File

@ -22,5 +22,5 @@ export const InfluxWriteAPI = influxClient.getWriteApi(
);
export const InfluxQueryAPI = influxClient.getQueryApi(INFLUXDB_ORG);
require("./updateData");
require("./api");
require("./services/updateData");
require("./services/api");

View File

@ -23,15 +23,15 @@ app.get("/analytics", async (req, res) => {
const rows = await InfluxQueryAPI.collectRows(getPlayerHistoryQuery);
let history = rows.map((row: any) => ({
time: row._time,
value: row._value.toFixed(0),
value: row._value !== null ? row._value.toFixed(0) : null,
}));
history = history.sort(
(a: any, b: any) => new Date(a.time).getTime() - new Date(b.time).getTime()
);
return res.json({
serverTimeTaken: new Date().getTime() - before + "ms",
history: history,
serverTimeTaken: new Date().getTime() - before,
});
});