Skip to content

Commit

Permalink
Merge pull request #434 from openinfradev/fix_favorite
Browse files Browse the repository at this point in the history
trivial. add favorite field to stack response
  • Loading branch information
ktkfree authored Apr 25, 2024
2 parents 53c4ff8 + 655df01 commit b23c457
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/delivery/http/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (h *StackHandler) InstallStack(w http.ResponseWriter, r *http.Request) {
ResponseJSON(w, r, http.StatusOK, nil)
}

// GetStack godoc
// GetStacks godoc
//
// @Tags Stacks
// @Summary Get Stacks
Expand Down
6 changes: 6 additions & 0 deletions internal/usecase/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ func (u *StackUsecase) Fetch(ctx context.Context, organizationId string, pg *pag
}
}

if cluster.Favorites != nil && len(*cluster.Favorites) > 0 {
outStack.Favorited = true
} else {
outStack.Favorited = false
}

out = append(out, outStack)
}

Expand Down

0 comments on commit b23c457

Please sign in to comment.