mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 07:00:47 +02:00
Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
@@ -22,34 +22,36 @@ module.exports = ProjectDownloadsController = {
|
||||
downloadProject(req, res, next) {
|
||||
const project_id = req.params.Project_id
|
||||
Metrics.inc('zip-downloads')
|
||||
return DocumentUpdaterHandler.flushProjectToMongo(project_id, function(
|
||||
error
|
||||
) {
|
||||
if (error != null) {
|
||||
return next(error)
|
||||
}
|
||||
return ProjectGetter.getProject(project_id, { name: true }, function(
|
||||
error,
|
||||
project
|
||||
) {
|
||||
return DocumentUpdaterHandler.flushProjectToMongo(
|
||||
project_id,
|
||||
function (error) {
|
||||
if (error != null) {
|
||||
return next(error)
|
||||
}
|
||||
return ProjectZipStreamManager.createZipStreamForProject(
|
||||
return ProjectGetter.getProject(
|
||||
project_id,
|
||||
function(error, stream) {
|
||||
{ name: true },
|
||||
function (error, project) {
|
||||
if (error != null) {
|
||||
return next(error)
|
||||
}
|
||||
res.setContentDisposition('attachment', {
|
||||
filename: `${project.name}.zip`
|
||||
})
|
||||
res.contentType('application/zip')
|
||||
return stream.pipe(res)
|
||||
return ProjectZipStreamManager.createZipStreamForProject(
|
||||
project_id,
|
||||
function (error, stream) {
|
||||
if (error != null) {
|
||||
return next(error)
|
||||
}
|
||||
res.setContentDisposition('attachment', {
|
||||
filename: `${project.name}.zip`
|
||||
})
|
||||
res.contentType('application/zip')
|
||||
return stream.pipe(res)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
downloadMultipleProjects(req, res, next) {
|
||||
@@ -57,13 +59,13 @@ module.exports = ProjectDownloadsController = {
|
||||
Metrics.inc('zip-downloads-multiple')
|
||||
return DocumentUpdaterHandler.flushMultipleProjectsToMongo(
|
||||
project_ids,
|
||||
function(error) {
|
||||
function (error) {
|
||||
if (error != null) {
|
||||
return next(error)
|
||||
}
|
||||
return ProjectZipStreamManager.createZipStreamForMultipleProjects(
|
||||
project_ids,
|
||||
function(error, stream) {
|
||||
function (error, stream) {
|
||||
if (error != null) {
|
||||
return next(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user