mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
use json parsing in request
This commit is contained in:
parent
5368630754
commit
f99023320d
1 changed files with 6 additions and 4 deletions
|
@ -81,13 +81,14 @@ module.exports = Client = {
|
|||
file,
|
||||
line,
|
||||
column
|
||||
}
|
||||
},
|
||||
json: true
|
||||
},
|
||||
(error, response, body) => {
|
||||
if (error != null) {
|
||||
return callback(error)
|
||||
}
|
||||
return callback(null, JSON.parse(body))
|
||||
return callback(null, body)
|
||||
}
|
||||
)
|
||||
},
|
||||
|
@ -103,13 +104,14 @@ module.exports = Client = {
|
|||
page,
|
||||
h,
|
||||
v
|
||||
}
|
||||
},
|
||||
json: true
|
||||
},
|
||||
(error, response, body) => {
|
||||
if (error != null) {
|
||||
return callback(error)
|
||||
}
|
||||
return callback(null, JSON.parse(body))
|
||||
return callback(null, body)
|
||||
}
|
||||
)
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue