Kaltsoon / sequelize-cursor-pagination

➡️ Cursor-based pagination queries for Sequelize models
86 stars 27 forks source link

Support ordering with DESC / ASC NULL FIRST #59

Closed jadhavmanoj closed 2 years ago

jadhavmanoj commented 2 years ago

When we pass DESC NULL FIRST in order list, it choose different operator & unexpected data returns.

Probable fix for this is - src/utils.ts

const currentOp = order[0][1].toLowerCase().split(" ")[0] === 'desc' ? Op.lt : Op.gt;

Let me know if you have any other suggestion. So I will create a PR.

Kaltsoon commented 2 years ago

Sounds good!