mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-19 21:11:03 +00:00
[misc] CompileController: simplify composing of outputFiles
This commit is contained in:
parent
f32f5e58a8
commit
fb3966ef35
2 changed files with 4 additions and 22 deletions
|
@ -123,7 +123,7 @@ module.exports = CompileController = {
|
||||||
stats,
|
stats,
|
||||||
timings,
|
timings,
|
||||||
outputFiles: outputFiles.map((file) => {
|
outputFiles: outputFiles.map((file) => {
|
||||||
const record = {
|
return {
|
||||||
url:
|
url:
|
||||||
`${Settings.apis.clsi.url}/project/${request.project_id}` +
|
`${Settings.apis.clsi.url}/project/${request.project_id}` +
|
||||||
(request.user_id != null
|
(request.user_id != null
|
||||||
|
@ -131,18 +131,8 @@ module.exports = CompileController = {
|
||||||
: '') +
|
: '') +
|
||||||
(file.build != null ? `/build/${file.build}` : '') +
|
(file.build != null ? `/build/${file.build}` : '') +
|
||||||
`/output/${file.path}`,
|
`/output/${file.path}`,
|
||||||
path: file.path,
|
...file
|
||||||
type: file.type,
|
|
||||||
build: file.build,
|
|
||||||
contentId: file.contentId
|
|
||||||
}
|
}
|
||||||
if (file.ranges != null) {
|
|
||||||
record.ranges = file.ranges
|
|
||||||
}
|
|
||||||
if (file.size != null) {
|
|
||||||
record.size = file.size
|
|
||||||
}
|
|
||||||
return record
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -157,11 +157,7 @@ describe('CompileController', function () {
|
||||||
outputFiles: this.output_files.map((file) => {
|
outputFiles: this.output_files.map((file) => {
|
||||||
return {
|
return {
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
||||||
path: file.path,
|
...file
|
||||||
type: file.type,
|
|
||||||
build: file.build,
|
|
||||||
// gets dropped by JSON.stringify
|
|
||||||
contentId: undefined
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -202,11 +198,7 @@ describe('CompileController', function () {
|
||||||
outputFiles: this.output_files.map((file) => {
|
outputFiles: this.output_files.map((file) => {
|
||||||
return {
|
return {
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
||||||
path: file.path,
|
...file
|
||||||
type: file.type,
|
|
||||||
build: file.build,
|
|
||||||
// gets dropped by JSON.stringify
|
|
||||||
contentId: undefined
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue