Skip to content

Adding pagination hooks and bug fixes

Choose a tag to compare

@thetutlage thetutlage released this 15 May 06:38

Pagination hooks

We have added ORM hooks for pagination too.

beforePaginate

class User extends BaseModel {
  @beforePaginate()
  public static someMethod ([countQuery, query]) {
  }
}

afterPaginate

class User extends BaseModel {
  @afterPaginate()
  public static someMethod (paginator) {
    console.log(paginator.all())
    console.log(paginator.total)
  }
}

Commits

  • chore: update dependencies f7bd18f
  • feat: add pagination hooks 1f9b1d3
  • fix: re-compute dirty properties after initiating auto update columns b309acb
  • chore: update dependencies ef3cf10
  • fix(serialization): pick all fields when pick property is undefined fa0a214
  • improvement: updateOrCreate and updateOrCreateMany can handle concurrent updates too 5bee648
  • chore: update dependencies 4754a8c
  • chore: update dependencies ed90d3a

v8.1.0...v8.1.1