add flex role to export endpoint

This commit is contained in:
timothycarambat 2024-01-14 17:10:49 -08:00
parent e1dcd5ded0
commit 7aaa4b38e7

View file

@ -389,15 +389,19 @@ function systemEndpoints(app) {
}
});
app.get("/system/data-export", [validatedRequest], async (_, response) => {
try {
const { filename, error } = await exportData();
response.status(200).json({ filename, error });
} catch (e) {
console.log(e.message, e);
response.sendStatus(500).end();
app.get(
"/system/data-export",
[validatedRequest, flexUserRoleValid],
async (_, response) => {
try {
const { filename, error } = await exportData();
response.status(200).json({ filename, error });
} catch (e) {
console.log(e.message, e);
response.sendStatus(500).end();
}
}
});
);
app.get("/system/data-exports/:filename", (request, response) => {
const exportLocation = __dirname + "/../storage/exports/";