fastcrud
fastcrud copied to clipboard
Bug: get_multi_by_cursor does not work in descending order
https://github.com/igorbenav/fastcrud/blob/47fe52d5e971c54599524f1147fd99ad85585aba/fastcrud/crud/fast_crud.py#L2148-L2152
When setting sort_order="desc" next cursor is always None due to a bug in lines above. next_cursor is not assigned, and the logic is wrong.
I think this is what it should be.
if len(data) == limit:
next_cursor = data[-1][sort_column]
Hey, @yunmanger1, thanks! I'll take a look at it this weekend.
Make a fix and covered by tests here: https://github.com/igorbenav/fastcrud/pull/216
@yunmanger1 #216 is resolving this issue, can you test it from main branch?
Fixed by #216