Skip to content

Commit

Permalink
fix(api): endpoint which must delete user from project, delete whole …
Browse files Browse the repository at this point in the history
…project
  • Loading branch information
fiftin committed Dec 1, 2020
1 parent eee34fb commit 4dbe018
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func Route() *mux.Router {
tokenAPI.Path("/tokens").HandlerFunc(createAPIToken).Methods("POST")
tokenAPI.HandleFunc("/tokens/{token_id}", expireAPIToken).Methods("DELETE")

userAPI := authenticatedAPI.PathPrefix("/users/{user_id}").Subrouter()
userAPI := authenticatedAPI.Path("/users/{user_id}").Subrouter()
userAPI.Use(getUserMiddleware)

userAPI.Methods("GET", "HEAD").HandlerFunc(getUser)
Expand Down Expand Up @@ -139,7 +139,7 @@ func Route() *mux.Router {
projectUserAPI.Path("/templates").HandlerFunc(projects.GetTemplates).Methods("GET", "HEAD")
projectUserAPI.Path("/templates").HandlerFunc(projects.AddTemplate).Methods("POST")

projectAdminAPI := authenticatedAPI.PathPrefix("/project/{project_id}").Subrouter()
projectAdminAPI := authenticatedAPI.Path("/project/{project_id}").Subrouter()
projectAdminAPI.Use(projects.ProjectMiddleware, projects.MustBeAdmin)

projectAdminAPI.Methods("PUT").HandlerFunc(projects.UpdateProject)
Expand Down

0 comments on commit 4dbe018

Please sign in to comment.