File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 7
7
8
8
< script >
9
9
( async function ( ) {
10
- const stage = ( await fetch ( 'http://localhost:3000/stage?number=1' ) . then ( res => res . json ( ) ) ) [ 0 ] ;
11
- const data = await fetch ( 'http://localhost:3000/db' ) . then ( res => res . json ( ) ) ;
10
+ const data = await fetch ( 'http://localhost:3000/db' )
11
+ . catch ( ( ) => alert ( 'Failed to fetch localhost. Please do `npm run db` or use json-server your own way.' ) )
12
+ . then ( res => res . json ( ) ) ;
12
13
13
14
bracketsViewer . render ( '#root' , {
14
- stage,
15
+ stage : data . stage [ 0 ] ,
15
16
groups : data . group ,
16
17
rounds : data . round ,
17
18
matches : data . match ,
23
24
showLowerBracketSlotsOrigin : true ,
24
25
highlightParticipantOnHover : true ,
25
26
} ) ;
26
- } ) ( ) . catch ( ( ) => {
27
- alert ( 'Failed to fetch localhost. Please do `npm run db` or use json-server your own way.' ) ;
28
- } ) ;
27
+ } ) ( )
29
28
</ script >
You can’t perform that action at this time.
0 commit comments