This commit is contained in:
Carlos Valente
2022-09-19 21:15:06 +02:00
committed by GitHub
parent fc0cbf6134
commit 70436059d8
71 changed files with 2001 additions and 1175 deletions
@@ -234,6 +234,34 @@ export const postSettings = async (req, res) => {
}
};
/**
* @description Get view Settings
* @method GET
*/
export const getViewSettings = async (req, res) => {
res.status(200).send({ ...data.views });
};
/**
* @description Change view Settings
* @method POST
*/
export const postViewSettings = async (req, res) => {
if (!req.body) {
res.status(400).send('No object found in request');
return;
}
try {
data.views = {
overrideStyles: req.body?.overrideStyles ?? data.views.overrideStyles,
};
await db.write();
res.sendStatus(200);
} catch (error) {
res.status(400).send(error);
}
};
// Create controller for POST request to '/ontime/info'
// Returns ACK message
export const postInfo = async (req, res) => {