fix: gender and previous state for DEMO

This commit is contained in:
2025-05-18 16:01:05 +02:00
parent 48f282423f
commit a6ebc28d47
3 changed files with 26 additions and 18 deletions

View File

@@ -87,8 +87,12 @@ function ChemistryDnD({ user, teams, players }: PlayerInfoProps) {
async function handleGet() {
setLoading(true);
const data = await apiAuth(`chemistry/${teams.activeTeam}`, null, "GET");
if (data.detail) alert(data.detail);
else {
if (data.detail) {
console.log(data.detail);
setPlayersRight([]);
setPlayersMiddle(otherPlayers);
setPlayersLeft([]);
} else {
const chemistry = data as Chemistry;
setPlayersLeft(filterSort(otherPlayers, chemistry.hate));
setPlayersMiddle(
@@ -198,8 +202,11 @@ function MVPDnD({ user, teams, players }: PlayerInfoProps) {
async function handleGet() {
setLoading(true);
const data = await apiAuth(`mvps/${teams.activeTeam}`, null, "GET");
if (data.detail) alert(data.detail);
else {
if (data.detail) {
console.log(data.detail);
setAvailablePlayers(players);
setRankedPlayers([]);
} else {
const mvps = data as MVPRanking;
setRankedPlayers(filterSort(players, mvps.mvps));
setAvailablePlayers(