mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 18:03:47 +00:00
feat: allow download of current project
This commit is contained in:
committed by
Carlos Valente
parent
cfb76153a0
commit
f1cac8d1c4
@@ -58,6 +58,19 @@ export async function createProjectFile(req: Request, res: Response<{ filename:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows downloading of current project file
|
||||
*/
|
||||
export async function currentProjectDownload(_req: Request, res: Response) {
|
||||
const { filename, pathToFile } = await projectService.getCurrentProject();
|
||||
res.download(pathToFile, filename, (error) => {
|
||||
if (error) {
|
||||
const message = getErrorMessage(error);
|
||||
res.status(500).send({ message });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows downloading of project files
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user