gitbrent/SpRestLib

Incorrect request parameter when using only one queryNext option

bagau opened this issue · 2 comments

bagau commented

When I use only one option sprLib.list().items({ queryNext: { prevId: 29, maxItems: 5 } }), it requests like this http://localhost:3000/_api/lists/getbytitle('UsersDetail')/items&p_ID=29&$top=5.
You can see than before p_ID=29 stand & intstead of ?.
And I get an error Invalid argument.

But if I add more than one option on request, like this:
sprLib.list(usersList).items({ listCols: ['ID'], queryNext: { prevId: 29, maxItems: 5 } });, my request is good http://localhost:3000/_api/lists/getbytitle('UsersDetail')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d29&%24select=ID&p_ID=29&$top=5 and before my first GET argument stands question symbol ?

Hi @bagau

When no column names are provided, the library attempts to retrieve all the columns (/items), but this behavior runs into trouble when options are provided.

Any chanse on fixing this bug in the feature?