Skip to content

Commit

Permalink
fix: change default sorting on readAndCount() to id column which shou…
Browse files Browse the repository at this point in the history
…ld always exist
  • Loading branch information
etienne-bechara committed May 20, 2021
1 parent 382d0e4 commit 9e369f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/orm/orm.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ export abstract class OrmService<Entity> {
* @param options
*/
public async readAndCount(params: OrmReadParams<Entity>, options: OrmReadOptions<Entity> = { }): Promise<OrmPagination<Entity>> {
options.sort ??= 'updated';
options.order ??= OrmQueryOrder.DESC;
options.sort ??= 'id';
options.order ??= OrmQueryOrder.ASC;
options.limit ||= 100;
options.offset ??= 0;

Expand Down

0 comments on commit 9e369f9

Please sign in to comment.