SpRestLib icon indicating copy to clipboard operation
SpRestLib copied to clipboard

Incorrect request parameter when using only one queryNext option

Open bagau opened this issue 5 years ago • 2 comments

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 ?

bagau avatar Apr 05 '19 10:04 bagau

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.

gitbrent avatar Apr 06 '19 02:04 gitbrent

Any chanse on fixing this bug in the feature?

TimVanOnckelen avatar Oct 26 '19 15:10 TimVanOnckelen