Skip to content

Commit

Permalink
update routes
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari committed May 18, 2024
1 parent bc35208 commit 9431b0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/03_features.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('Get Features for Workspace', () => {
cy.upsertlogin(User).then(value => {
cy.request({
method: 'GET',
url: `${HostName}/features/forworkspace/` + Features[0].workspace_uuid,
url: `${HostName}/workspaces/` + Features[0].workspace_uuid + `/features`,
headers: { 'x-jwt': `${value}` },
body: {}
}).then((resp) => {
Expand Down
1 change: 0 additions & 1 deletion routes/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ func FeatureRoutes() chi.Router {

r.Post("/", featureHandlers.CreateOrEditFeatures)
r.Get("/{uuid}", featureHandlers.GetFeatureByUuid)
r.Get("/forworkspace/{uuid}", featureHandlers.GetFeaturesByWorkspaceUuid)
r.Get("/workspace/count/{uuid}", featureHandlers.GetWorkspaceFeaturesCount)
r.Delete("/{uuid}", featureHandlers.DeleteFeature)

Expand Down
3 changes: 3 additions & 0 deletions routes/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
func WorkspaceRoutes() chi.Router {
r := chi.NewRouter()
workspaceHandlers := handlers.NewWorkspaceHandler(db.DB)
featureHandlers := handlers.NewFeatureHandler(&db.DB)
r.Group(func(r chi.Router) {
r.Get("/", handlers.GetWorkspaces)
r.Get("/count", handlers.GetWorkspacesCount)
Expand Down Expand Up @@ -45,6 +46,8 @@ func WorkspaceRoutes() chi.Router {

r.Post("/repositories", workspaceHandlers.CreateWorkspaceRepository)
r.Get("/repositories/{uuid}", workspaceHandlers.GetWorkspaceRepositorByWorkspaceUuid)

r.Get("/{uuid}/features", featureHandlers.GetFeaturesByWorkspaceUuid)
})
return r
}

0 comments on commit 9431b0b

Please sign in to comment.