Skip to content

Commit

Permalink
fix: typeorm sucks - sort column name bug when using take()
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyoptimist committed Sep 3, 2024
1 parent 4f4bb19 commit 0fd28dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ export class UserService {
query.addOrderBy('email', sortParam.order);
}
if (sortParam.fieldName === 'firstName') {
query.addOrderBy('first_name', sortParam.order);
query.addOrderBy('firstName', sortParam.order);
}
if (sortParam.fieldName === 'lastName') {
query.addOrderBy('last_name', sortParam.order);
query.addOrderBy('lastName', sortParam.order);
}
}

Expand Down

0 comments on commit 0fd28dd

Please sign in to comment.