mirror of
https://github.com/evroon/bracket.git
synced 2026-05-24 16:41:06 -04:00
Fix round order (#119)
This commit is contained in:
@@ -51,7 +51,7 @@ class UvicornTestServer(uvicorn.Server):
|
||||
|
||||
async def startup(self, sockets: Optional[Sequence[socket.socket]] = None) -> None:
|
||||
sockets_list = list(sockets) if sockets is not None else sockets
|
||||
await super().startup(sockets=sockets_list)
|
||||
await super().startup(sockets=sockets_list) # type: ignore[arg-type]
|
||||
self.config.setup_event_loop()
|
||||
self._startup_done.set()
|
||||
|
||||
|
||||
@@ -32,17 +32,19 @@ export default function Brackets({
|
||||
);
|
||||
}
|
||||
|
||||
const rounds = swrRoundsResponse.data.data.map((round: RoundInterface) => (
|
||||
<Grid.Col sm={6} lg={4} xl={3} key={round.id}>
|
||||
<Round
|
||||
tournamentData={tournamentData}
|
||||
round={round}
|
||||
swrRoundsResponse={swrRoundsResponse}
|
||||
swrUpcomingMatchesResponse={swrUpcomingMatchesResponse}
|
||||
readOnly={readOnly}
|
||||
/>
|
||||
</Grid.Col>
|
||||
));
|
||||
const rounds = swrRoundsResponse.data.data
|
||||
.sort((r1: any, r2: any) => (r1.name > r2.name ? 1 : 0))
|
||||
.map((round: RoundInterface) => (
|
||||
<Grid.Col sm={6} lg={4} xl={3} key={round.id}>
|
||||
<Round
|
||||
tournamentData={tournamentData}
|
||||
round={round}
|
||||
swrRoundsResponse={swrRoundsResponse}
|
||||
swrUpcomingMatchesResponse={swrUpcomingMatchesResponse}
|
||||
readOnly={readOnly}
|
||||
/>
|
||||
</Grid.Col>
|
||||
));
|
||||
|
||||
return <Grid>{rounds}</Grid>;
|
||||
}
|
||||
|
||||
@@ -6,17 +6,17 @@ export async function performLogin(username: string, password: string) {
|
||||
bodyFormData.append('username', username);
|
||||
bodyFormData.append('password', password);
|
||||
|
||||
const response = await createAxios()
|
||||
const { data } = await createAxios()
|
||||
.post('token', bodyFormData)
|
||||
.catch((err_response: any) => handleRequestError(err_response));
|
||||
|
||||
if (response == null) {
|
||||
if (data == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
localStorage.setItem('login', JSON.stringify(response.data));
|
||||
localStorage.setItem('login', JSON.stringify(data));
|
||||
|
||||
handleRequestError(response);
|
||||
handleRequestError(data);
|
||||
|
||||
// Reload axios object.
|
||||
createAxios();
|
||||
|
||||
Reference in New Issue
Block a user