Skip to content

Commit d3115e3

Browse files
authored
chore: clean swagger API queries (#1366)
1 parent 9225930 commit d3115e3

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

pkg/server/handler/resource/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (h *Handler) GetResource() http.HandlerFunc {
9393
// @Description Get resource graph by stack ID
9494
// @Tags resource
9595
// @Produce json
96-
// @Param stack_id query uint true "Stack ID"
96+
// @Param stackID query uint true "Stack ID"
9797
// @Success 200 {object} handler.Response{data=entity.ResourceGraph} "Success"
9898
// @Failure 400 {object} error "Bad Request"
9999
// @Failure 401 {object} error "Unauthorized"

pkg/server/handler/stack/handler.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ func (h *Handler) GetStack() http.HandlerFunc {
169169
// @Param projectID query uint false "ProjectID to filter stacks by. Default to all"
170170
// @Param orgID query uint false "OrgID to filter stacks by. Default to all"
171171
// @Param projectName query string false "ProjectName to filter stacks by. Default to all"
172-
// @Param cloud query string false "Cloud to filter stacks by. Default to all"
173-
// @Param env query string false "Environment to filter stacks by. Default to all"
172+
// @Param path query string false "Path to filter stacks by. Default to all"
174173
// @Param page query uint false "The current page to fetch. Default to 1"
175174
// @Param pageSize query uint false "The size of the page. Default to 10"
176175
// @Success 200 {object} handler.Response{data=response.PaginatedStackResponse} "Success"

pkg/server/handler/stack/run.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ func (h *Handler) GetRunResult() http.HandlerFunc {
7979
// @Tags stack
8080
// @Produce json
8181
// @Param projectID query uint false "ProjectID to filter runs by. Default to all"
82-
// @Param orgID query uint false "OrgID to filter runs by. Default to all"
83-
// @Param projectName query string false "ProjectName to filter runs by. Default to all"
84-
// @Param cloud query string false "Cloud to filter runs by. Default to all"
85-
// @Param env query string false "Environment to filter runs by. Default to all"
8682
// @Param type query []string false "RunType to filter runs by. Default to all"
8783
// @Param status query []string false "RunStatus to filter runs by. Default to all"
8884
// @Param stackID query uint false "StackID to filter runs by. Default to all"

pkg/server/handler/workspace/handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ func (h *Handler) GetWorkspace() http.HandlerFunc {
147147
// @Description List all workspaces
148148
// @Tags workspace
149149
// @Produce json
150+
// @Param backendID query uint false "BackendID to filter workspaces by. Default to all"
150151
// @Param page query uint false "The current page to fetch. Default to 1"
151152
// @Param pageSize query uint false "The size of the page. Default to 10"
152153
// @Success 200 {object} handler.Response{data=response.PaginatedWorkspaceResponse} "Success"

pkg/server/manager/stack/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func (m *StackManager) BuildStackFilter(ctx context.Context, query *url.Values)
251251
orgIDParam := query.Get("orgID")
252252
projectIDParam := query.Get("projectID")
253253
projectNameParam := query.Get("projectName")
254-
envParam := query.Get("env")
254+
pathParam := query.Get("path")
255255

256256
if orgIDParam != "" {
257257
orgID, err := strconv.Atoi(orgIDParam)
@@ -274,8 +274,8 @@ func (m *StackManager) BuildStackFilter(ctx context.Context, query *url.Values)
274274
return nil, err
275275
}
276276
filter.ProjectID = projectEntity.ID
277-
if envParam != "" {
278-
filter.Path = fmt.Sprintf("%s/%s", projectEntity.Path, envParam)
277+
if pathParam != "" {
278+
filter.Path = pathParam
279279
logger.Info("Showing path filter without cloud", "filter.Path: ", filter.Path)
280280
}
281281
}

0 commit comments

Comments
 (0)