olavim / objection-cursor

Cursor based pagination plugin for Objection.js
MIT License
30 stars 8 forks source link

Using `before = true` doesn't return the expected data structure. #11

Closed cerinoligutom closed 4 years ago

cerinoligutom commented 4 years ago

The returned data is the snippet below when using previousCursorPage()

{
  results: {
    results: [
      // model results
    ],
    pageInfo: {
      // page info properties
    }
}

It seems to be working fine when using nextCursorPage()

{
  results: [
    // model results
  ],
  pageInfo: {
    // page info properties
  }
}
olavim commented 4 years ago

Thank you for making an issue. Sorry for taking so long to answer.

This should be tested pretty extensively. See https://github.com/olavim/objection-cursor/blob/master/test/cursor.js#L122, for example.

Could you show me code that is giving you the wrong response structure? Also, which version of Objection are you using?

olavim commented 4 years ago

Closing as stale

cerinoligutom commented 4 years ago

Thank you for making an issue. Sorry for taking so long to answer.

This should be tested pretty extensively. See https://github.com/olavim/objection-cursor/blob/master/test/cursor.js#L122, for example.

Could you show me code that is giving you the wrong response structure? Also, which version of Objection are you using?

Sorry for getting back late, a coworker was having the issue previously. Not quite sure what's their course of action for it but seems like they've resolved it.