Skip to content

Commit aeff714

Browse files
committed
refactor: update sorting logic in UsersRepository to include nulls handling
- Modified the sorting structure to include an object that specifies sorting direction and nulls placement, enhancing the sorting functionality.
1 parent ae50e2e commit aeff714

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modules/users/repositories/users.repository.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ export class UsersRepository implements ICrud<UserEntity> {
363363
let orderBy = sorting?.reduce(
364364
(acc, sort) => ({
365365
...acc,
366-
[sort.id]: sort.desc ? 'desc' : 'asc',
366+
[sort.id]: {
367+
sort: sort.desc ? 'desc' : 'asc',
368+
nulls: 'last',
369+
},
367370
}),
368371
{},
369372
);

0 commit comments

Comments
 (0)