mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Send 204 rather than redirect when leaving a project
This commit is contained in:
@@ -19,7 +19,7 @@ module.exports = CollaboratorsController =
|
||||
return next(new Error("User should be logged in"))
|
||||
CollaboratorsHandler.removeUserFromProject req.params.project_id, user_id, (error) ->
|
||||
return next(error) if error?
|
||||
res.redirect "/project"
|
||||
res.send 204
|
||||
|
||||
_formatCollaborators: (project, callback = (error, collaborators) ->) ->
|
||||
collaborators = []
|
||||
|
||||
+2
-2
@@ -63,8 +63,8 @@ describe "CollaboratorsController", ->
|
||||
it "should remove the logged in user from the project", ->
|
||||
@CollaboratorsHandler.removeUserFromProject.calledWith(@project_id, @user_id)
|
||||
|
||||
it "should redirect to the project page", ->
|
||||
@res.redirectedTo.should.equal "/project"
|
||||
it "should return a success code", ->
|
||||
@res.statusCode.should.equal 204
|
||||
|
||||
describe "_formatCollaborators", ->
|
||||
beforeEach ->
|
||||
|
||||
Reference in New Issue
Block a user