Merge pull request #2672 from overleaf/jpa-import-670

[misc] ProjectUploadController: use camelCase for log context fields

GitOrigin-RevId: f834fe1546dd8e94830251b5cd63f8407cd6a482
This commit is contained in:
Eric Mc Sween 2020-03-16 07:31:00 -04:00 committed by Copybot
parent 574e6262a9
commit 44cb795050

View file

@ -59,7 +59,7 @@ module.exports = ProjectUploadController = {
timer.done() timer.done()
if (error != null) { if (error != null) {
logger.error( logger.error(
{ err: error, file_path: path, file_name: name }, { err: error, filePath: path, fileName: name },
'error uploading project' 'error uploading project'
) )
if (error instanceof InvalidZipFileError) { if (error instanceof InvalidZipFileError) {
@ -87,7 +87,10 @@ module.exports = ProjectUploadController = {
const project_id = req.params.Project_id const project_id = req.params.Project_id
const { folder_id } = req.query const { folder_id } = req.query
if (name == null || name.length === 0 || name.length > 150) { if (name == null || name.length === 0 || name.length > 150) {
logger.err({ project_id, name }, 'bad name when trying to upload file') logger.err(
{ projectId: project_id, fileName: name },
'bad name when trying to upload file'
)
return res.send({ success: false }) return res.send({ success: false })
} }
const user_id = AuthenticationController.getLoggedInUserId(req) const user_id = AuthenticationController.getLoggedInUserId(req)
@ -106,10 +109,10 @@ module.exports = ProjectUploadController = {
logger.error( logger.error(
{ {
err: error, err: error,
project_id, projectId: project_id,
file_path: path, filePath: path,
file_name: name, fileName: name,
folder_id folderId: folder_id
}, },
'error uploading file' 'error uploading file'
) )