mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 12:51:35 +02:00
updated mock methods to express v4 signatures
This commit is contained in:
@@ -28,10 +28,10 @@ module.exports = MockDocUpdaterApi = {
|
||||
app.get('/project/:project_id/doc', (req, res, next) => {
|
||||
return this.getAllDoc(req.params.project_id, (error, docs) => {
|
||||
if (error != null) {
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
}
|
||||
if (docs == null) {
|
||||
return res.send(404)
|
||||
return res.sendStatus(404)
|
||||
} else {
|
||||
return res.send(JSON.stringify(docs))
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ module.exports = MockDocUpdaterApi = {
|
||||
req.params.doc_id,
|
||||
(error, doc) => {
|
||||
if (error != null) {
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
}
|
||||
if (doc == null) {
|
||||
return res.send(404)
|
||||
return res.sendStatus(404)
|
||||
} else {
|
||||
return res.send(JSON.stringify(doc))
|
||||
}
|
||||
@@ -67,9 +67,9 @@ module.exports = MockDocUpdaterApi = {
|
||||
req.body.undoing,
|
||||
(errr, doc) => {
|
||||
if (typeof error !== 'undefined' && error !== null) {
|
||||
return res.send(500)
|
||||
return res.sendStatus(500)
|
||||
} else {
|
||||
return res.send(204)
|
||||
return res.sendStatus(204)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -37,10 +37,10 @@ module.exports = MockWebApi = {
|
||||
app.get('/user/:user_id/personal_info', (req, res, next) => {
|
||||
return this.getUserInfo(req.params.user_id, (error, user) => {
|
||||
if (error != null) {
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
}
|
||||
if (user == null) {
|
||||
return res.send(404)
|
||||
return res.sendStatus(404)
|
||||
} else {
|
||||
return res.send(JSON.stringify(user))
|
||||
}
|
||||
@@ -50,10 +50,10 @@ module.exports = MockWebApi = {
|
||||
app.get('/project/:project_id/details', (req, res, next) => {
|
||||
return this.getProjectDetails(req.params.project_id, (error, project) => {
|
||||
if (error != null) {
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
}
|
||||
if (project == null) {
|
||||
return res.send(404)
|
||||
return res.sendStatus(404)
|
||||
} else {
|
||||
return res.send(JSON.stringify(project))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user