ランキング10位以上が表示されない不具合を修正

This commit is contained in:
Xeltica 2021-10-18 03:09:41 +09:00
parent fbcdf9bf5f
commit c717a42bb6

View File

@ -6,12 +6,12 @@ import { User } from '../models/entities/user';
* @param limit
* @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')
.where('"user"."bannedFromRanking" IS NOT TRUE')
.orderBy('"user".rating', 'DESC');
if (limit !== null) {
if (limit) {
query.limit(limit);
}