ランキング10位以上が表示されない不具合を修正
This commit is contained in:
parent
fbcdf9bf5f
commit
c717a42bb6
1 changed files with 2 additions and 2 deletions
|
@ -6,12 +6,12 @@ import { User } from '../models/entities/user';
|
||||||
* @param limit 取得する件数
|
* @param limit 取得する件数
|
||||||
* @returns ミス廃ランキング
|
* @returns ミス廃ランキング
|
||||||
*/
|
*/
|
||||||
export const getRanking = async (limit: number | null = 10): Promise<User[]> => {
|
export const getRanking = async (limit?: number | null): Promise<User[]> => {
|
||||||
const query = Users.createQueryBuilder('user')
|
const query = Users.createQueryBuilder('user')
|
||||||
.where('"user"."bannedFromRanking" IS NOT TRUE')
|
.where('"user"."bannedFromRanking" IS NOT TRUE')
|
||||||
.orderBy('"user".rating', 'DESC');
|
.orderBy('"user".rating', 'DESC');
|
||||||
|
|
||||||
if (limit !== null) {
|
if (limit) {
|
||||||
query.limit(limit);
|
query.limit(limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue