report admin fix

This commit is contained in:
Ivan 2023-09-18 05:03:16 +03:00
parent 04f673fdbb
commit 40b0f66cf4
Signed by untrusted user who does not match committer: ppechenkoo
GPG Key ID: 0C191B86D9582583

View File

@ -1496,7 +1496,7 @@ app.get('/reports/:id', async (req, res) => {
actualSpeed = alarm.speed actualSpeed = alarm.speed
} }
if (serialValues.includes(alarm.serial)) { if (serialValues.includes(alarm.serial) || templateData.isAdmin) {
templateData.Type = type; templateData.Type = type;
templateData.Speed = actualSpeed; templateData.Speed = actualSpeed;
@ -1922,7 +1922,7 @@ async function devices(req, res) {
GroupsList: groupsResult.rows, GroupsList: groupsResult.rows,
}; };
console.log(templateData); // console.log(templateData);
const source = fs.readFileSync("static/templates/devices/index.html", "utf8"); const source = fs.readFileSync("static/templates/devices/index.html", "utf8");
const template = handlebars.compile(source); const template = handlebars.compile(source);
@ -2966,7 +2966,7 @@ app.post("/add-user", async (req, res) => {
} }
const { name, surname, email, phone, password } = req.body; const { name, surname, email, phone, password } = req.body;
console.log(name, surname, email, phone, password) // console.log(name, surname, email, phone, password)
try { try {