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

Api groups order #2138

Merged
merged 3 commits into from
Oct 6, 2016
Merged

Api groups order #2138

merged 3 commits into from
Oct 6, 2016

Conversation

billmn
Copy link
Contributor

@billmn billmn commented Oct 5, 2016

Issue: if the request use “?sort=order” returns groups ordered by “order DESC”.

This is unexpected.
If I would a reversed order I have to use “sort=order&order=desc”

Update from upstream repo CachetHQ/Cachet
Update from upstream repo CachetHQ/Cachet
Issue: if the request use “?sort=order” returns groups ordered by “order DESC”.

This is unexpected.
If I would a reversed order I have to use “sort=order&order=desc”
@GrahamCampbell GrahamCampbell added this to the V2.4.0 milestone Oct 5, 2016
@jbrooksuk jbrooksuk merged commit c778ce9 into cachethq:2.4 Oct 6, 2016
@jbrooksuk
Copy link
Member

One thing we should add is multiple sorts. Fancy this @billmn?

@billmn billmn deleted the api-groups-order branch October 6, 2016 09:36
@billmn
Copy link
Contributor Author

billmn commented Oct 6, 2016

@jbrooksuk Multiple sorts can introduce some BC but I think we can remove the "order" parameter using only "sort":

?sort=-status,order == ORDER BY status DESC, ORDER ASC

@jbrooksuk
Copy link
Member

I like it, but this breaks BC and I don't like that.

@ConnorVG
Copy link
Contributor

ConnorVG commented Oct 6, 2016

I agree with what @jbrooksuk said but I also have a question... What would be the 'default' definition for the sort orders if you're wanting it to go this way? Seems both opinionated and random to me.

@billmn
Copy link
Contributor Author

billmn commented Oct 6, 2016

@jbrooksuk I agree too, nobody loves BC :)

@ConnorVG If I don't specify the "sort" parameter I use a default sorting (eg: for component groups -> status DESC, order ASC).

If I specify the "sort" parameter:

  • with the hyphen the order is descending
  • without the hyphen the order is ascending

@ConnorVG
Copy link
Contributor

ConnorVG commented Oct 6, 2016

I see, I didn't notice the hyphen. Thanks.

@jbrooksuk
Copy link
Member

I guess we have to break BC on something like this?

@ConnorVG
Copy link
Contributor

ConnorVG commented Oct 7, 2016

We don't have to, especially if we use a versioned API.

@jbrooksuk
Copy link
Member

True. Although that's a ball ache to maintain.

@ConnorVG
Copy link
Contributor

ConnorVG commented Oct 7, 2016

🤔 💭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants