Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use searchStacks over stacks for listing stacks #246

Conversation

0michalsokolowski0
Copy link
Contributor

@0michalsokolowski0 0michalsokolowski0 commented Aug 28, 2024

Closes #242

@0michalsokolowski0 0michalsokolowski0 marked this pull request as ready for review August 28, 2024 11:51
sort.SliceStable(query.Stacks, func(i, j int) bool {
return strings.Compare(strings.ToLower(query.Stacks[i].Name), strings.ToLower(query.Stacks[j].Name)) < 0
stacks, err := searchStacks(ctx.Context, structs.SearchInput{
OrderBy: &structs.QueryOrder{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should follow the same logic as the default view in the UI for stacks? I think that one is

"orderBy": [
    {
        "field": "starred",
        "direction": "DESC"
    }
]
``

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, precisely. 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal/cmd/stack/list.go Outdated Show resolved Hide resolved
@0michalsokolowski0 0michalsokolowski0 self-assigned this Aug 28, 2024
@0michalsokolowski0 0michalsokolowski0 merged commit 4c916ad into main Aug 28, 2024
9 checks passed
@0michalsokolowski0 0michalsokolowski0 deleted the use-search-stacks-instead-of-stacks-when-listing-stacks branch August 28, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop using the stacks query
2 participants