diff --git a/cypress/e2e/03_features.cy.ts b/cypress/e2e/03_features.cy.ts index 069980a52..e9210a90a 100644 --- a/cypress/e2e/03_features.cy.ts +++ b/cypress/e2e/03_features.cy.ts @@ -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) => { diff --git a/routes/features.go b/routes/features.go index 469e39481..13c5f38c5 100644 --- a/routes/features.go +++ b/routes/features.go @@ -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) diff --git a/routes/workspaces.go b/routes/workspaces.go index d02c6e956..280821a50 100644 --- a/routes/workspaces.go +++ b/routes/workspaces.go @@ -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) @@ -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 }