mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-04-17 18:18:11 +00:00
add flex role to export endpoint
This commit is contained in:
parent
e1dcd5ded0
commit
7aaa4b38e7
1 changed files with 12 additions and 8 deletions
|
@ -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/";
|
||||
|
|
Loading…
Add table
Reference in a new issue