Parcourir la source

return doclines as array from getProjectDocs

for compatibility with getDoc
Brian Gough il y a 9 ans
Parent
commit
8372911a1b
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      services/document-updater/app/coffee/ProjectManager.coffee

+ 4 - 1
services/document-updater/app/coffee/ProjectManager.coffee

@@ -88,7 +88,10 @@ module.exports = ProjectManager =
 									if error?
 										logger.error err: error, project_id: project_id, doc_id: doc_id, "error getting project doc lines"
 										return cb(error)
-									docs.push {_id: doc_id, lines: lines, v: version}
+									try
+										docs.push {_id: doc_id, lines: JSON.parse(lines), v: version}
+									catch e
+										return cb(e)
 									cb()
 				async.series jobs, (error) ->
 					return callback(error) if error?