pilagod / gorm-cursor-paginator

A paginator doing cursor-based pagination based on GORM
https://github.com/pilagod/gorm-cursor-paginator
MIT License
192 stars 44 forks source link

Flip key order instead of global order for backward cursor #36

Closed sylviamoss closed 3 years ago

sylviamoss commented 3 years ago

I noticed the results for page back were different when I had a global order different from the key order. For this case, the global ordering was being flipped instead of the key one.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 157


Totals Coverage Status
Change from base Build 156: 0.0%
Covered Lines: 321
Relevant Lines: 329

💛 - Coveralls
sylviamoss commented 3 years ago

Hey @pilagod could you review this one?

pilagod commented 3 years ago

Hello @sylviamoss,

Nice catch! Thank you so much.

I am surprised that tests are not covering this case 😂. I will add more tests to cover this situation later. This PR can be merged first.

pilagod commented 3 years ago

I will release v2.0.1 to contain this fix.

sylviamoss commented 3 years ago

Nice! Thanks for reviewing and merging it 😄