Skip to content

Commit

Permalink
chore: clean swagger API queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangyang96 committed Dec 27, 2024
1 parent a3a9166 commit 6ffa60b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/server/handler/resource/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (h *Handler) GetResource() http.HandlerFunc {
// @Description Get resource graph by stack ID
// @Tags resource
// @Produce json
// @Param stack_id query uint true "Stack ID"
// @Param stackID query uint true "Stack ID"
// @Success 200 {object} handler.Response{data=entity.ResourceGraph} "Success"
// @Failure 400 {object} error "Bad Request"
// @Failure 401 {object} error "Unauthorized"
Expand Down
3 changes: 1 addition & 2 deletions pkg/server/handler/stack/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ func (h *Handler) GetStack() http.HandlerFunc {
// @Param projectID query uint false "ProjectID to filter stacks by. Default to all"
// @Param orgID query uint false "OrgID to filter stacks by. Default to all"
// @Param projectName query string false "ProjectName to filter stacks by. Default to all"
// @Param cloud query string false "Cloud to filter stacks by. Default to all"
// @Param env query string false "Environment to filter stacks by. Default to all"
// @Param path query string false "Path to filter stacks by. Default to all"
// @Param page query uint false "The current page to fetch. Default to 1"
// @Param pageSize query uint false "The size of the page. Default to 10"
// @Success 200 {object} handler.Response{data=response.PaginatedStackResponse} "Success"
Expand Down
4 changes: 0 additions & 4 deletions pkg/server/handler/stack/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ func (h *Handler) GetRunResult() http.HandlerFunc {
// @Tags stack
// @Produce json
// @Param projectID query uint false "ProjectID to filter runs by. Default to all"
// @Param orgID query uint false "OrgID to filter runs by. Default to all"
// @Param projectName query string false "ProjectName to filter runs by. Default to all"
// @Param cloud query string false "Cloud to filter runs by. Default to all"
// @Param env query string false "Environment to filter runs by. Default to all"
// @Param type query []string false "RunType to filter runs by. Default to all"
// @Param status query []string false "RunStatus to filter runs by. Default to all"
// @Param stackID query uint false "StackID to filter runs by. Default to all"
Expand Down
1 change: 1 addition & 0 deletions pkg/server/handler/workspace/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (h *Handler) GetWorkspace() http.HandlerFunc {
// @Description List all workspaces
// @Tags workspace
// @Produce json
// @Param backendID query uint false "BackendID to filter workspaces by. Default to all"
// @Param page query uint false "The current page to fetch. Default to 1"
// @Param pageSize query uint false "The size of the page. Default to 10"
// @Success 200 {object} handler.Response{data=response.PaginatedWorkspaceResponse} "Success"
Expand Down
6 changes: 3 additions & 3 deletions pkg/server/manager/stack/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (m *StackManager) BuildStackFilter(ctx context.Context, query *url.Values)
orgIDParam := query.Get("orgID")
projectIDParam := query.Get("projectID")
projectNameParam := query.Get("projectName")
envParam := query.Get("env")
pathParam := query.Get("path")

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

0 comments on commit 6ffa60b

Please sign in to comment.