File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,18 @@ function buildTitleRow(columns) {
99}
1010
1111function recheck ( trainingId ) {
12- console . log ( `Start recheck for ${ trainingId } ` )
13- fetch ( `/api/trainings/${ trainingId } /` , { method : "POST" } )
12+ fetch ( '/api/sessions/admin' )
1413 . then ( response => response . json ( ) )
15- . then ( innerResponseJson => {
16- if ( innerResponseJson [ "message" ] === "OK" ) {
17- window . open ( `/trainings/statistics/${ trainingId } /` ) ;
18- //location.href = `/trainings/statistics/${trainingId}/`;
14+ . then ( res => {
15+ if ( res . admin ) {
16+ fetch ( `/api/trainings/${ trainingId } /` , { method : "POST" } )
17+ . then ( response => response . json ( ) )
18+ . then ( innerResponseJson => {
19+ if ( innerResponseJson [ "message" ] === "OK" ) {
20+ window . open ( `/trainings/statistics/${ trainingId } /` ) ;
21+ //location.href = `/trainings/statistics/${trainingId}/`;
22+ }
23+ } ) ;
1924 }
2025 } ) ;
2126}
You can’t perform that action at this time.
0 commit comments