fastcrud icon indicating copy to clipboard operation
fastcrud copied to clipboard

Bug: get_multi_by_cursor does not work in descending order

Open yunmanger1 opened this issue 10 months ago • 3 comments

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]

yunmanger1 avatar Mar 11 '25 07:03 yunmanger1

Hey, @yunmanger1, thanks! I'll take a look at it this weekend.

igorbenav avatar Mar 20 '25 04:03 igorbenav

Make a fix and covered by tests here: https://github.com/igorbenav/fastcrud/pull/216

doubledare704 avatar Mar 31 '25 09:03 doubledare704

@yunmanger1 #216 is resolving this issue, can you test it from main branch?

doubledare704 avatar Apr 28 '25 16:04 doubledare704

Fixed by #216

igorbenav avatar May 17 '25 14:05 igorbenav