mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-24 12:29:30 -05:00
* Set up tables * Initial * Frontend for finalize tournament * Enter summaries to DB * Handle changes on tournament page after tournament is finalized * Fix streams tab text not centered * Add translations * Results on user page * Highlight logic for tournament results * Leaderboard page initial * Team leaderboard * CSS tweaks * Add unit tests * Add some i18n * Add leaderboards page meta * Support tournaments of size 2 * Add E2E test * Add missing group by
24 lines
594 B
TypeScript
24 lines
594 B
TypeScript
import { rating } from "openskill";
|
|
import { findCurrentSkillByUserId } from "./queries/findCurrentSkillByUserId.server";
|
|
import { findCurrentTeamSkillByIdentifier } from "./queries/findCurrentTeamSkillByIdentifier.server";
|
|
|
|
export function queryCurrentUserRating(userId: number) {
|
|
const skill = findCurrentSkillByUserId(userId);
|
|
|
|
if (!skill) {
|
|
return rating();
|
|
}
|
|
|
|
return rating(skill);
|
|
}
|
|
|
|
export function queryCurrentTeamRating(identifier: string) {
|
|
const skill = findCurrentTeamSkillByIdentifier(identifier);
|
|
|
|
if (!skill) {
|
|
return rating();
|
|
}
|
|
|
|
return rating(skill);
|
|
}
|