feat: Items data table.

This commit is contained in:
Ahmed Bouhuolia
2020-03-25 18:05:15 +02:00
parent 1894ad3b18
commit edd8693450
22 changed files with 567 additions and 20 deletions

View File

@@ -0,0 +1,17 @@
import { Model } from 'objection';
export default class PaginationQueryBuilder extends Model.QueryBuilder {
pagination(page, pageSize) {
return super.page(page, pageSize).runAfter(
({ results, total }) => {
return {
results,
pagination: {
total,
page: page + 1,
pageSize,
},
};
})
}
}