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

Multiple order on table ignores 2nd order #1222

Open
wheelie33 opened this issue Jun 12, 2024 · 3 comments
Open

Multiple order on table ignores 2nd order #1222

wheelie33 opened this issue Jun 12, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@wheelie33
Copy link

I have a simple table that has 2 columns I care about.

created_at: timestamp (always has a value)
read_on: timestamps (null if unread, value if read).

I want to show all unread first, then order the rest by created_at with newest first.

let { data: announcements, error: announcementError } = await supabase
      .from('announcements')
      .select('*')
      .eq('user_id', session?.user.id)
      .order('read_on', { nullsFirst: true })
      .order('created_at', { ascending: true });

That call doesn't seem to change the results at all. Running the 2nd order() by itself works as expected.

@wheelie33 wheelie33 added the bug Something isn't working label Jun 12, 2024
@wheelie33
Copy link
Author

Anyone able to reproduce this?

@wheelie33
Copy link
Author

hello?

@leohanon
Copy link

leohanon commented Aug 8, 2024

I can't reproduce, can you share a bit more details so I can set up my db the same way you are? the 2nd order seems to be working as expected for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants