CEO updated
This commit is contained in:
@@ -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..." });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user