CEO updated

This commit is contained in:
andrei-mihnea-cerbu
2024-04-20 03:18:44 +03:00
parent 869305a491
commit 57c2c7ec55
81 changed files with 3517 additions and 1035 deletions
+13 -2
View File
@@ -26,15 +26,26 @@ router.get('/reset_server', validateBody, (req, res) => {
const ceoDB = req.app.get('ceoDB');
usersDB.writeFile([]);
departmentsDB.writeFile([]);
departmentsDB.writeFile({});
backupSchemesDB.writeFile({});
ceoDB.writeFile({
id: uuidv4(),
name: "CEO",
email: "ceo@yourfirm.com",
password: crypto.randomBytes(16).toString('hex')
password: crypto.randomBytes(16).toString('hex'),
department: "CEO"
});
const ceoDepartment = {
name: "CEO",
key: crypto.randomBytes(32).toString('hex')
}
const departmentsJson = departmentsDB.readFile();
departmentsJson[1] = ceoDepartment;
departmentsDB.writeFile(departmentsJson);
res.status(httpStatus.OK).json({ message: "Resetting the server..." });
});