File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
atcoder-problems-frontend/src/pages/Internal/VirtualContest Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ interface Request {
22
22
penalty_second : number ;
23
23
}
24
24
25
- interface OuterProps {
25
+ interface Props {
26
26
contestId : string ;
27
27
}
28
28
@@ -33,13 +33,13 @@ const createAndUpdateContest = async (
33
33
const response = await updateVirtualContestInfo ( request ) . then ( ( ) =>
34
34
updateVirtualContestItems ( request . id , problems )
35
35
) ;
36
- return response . status ;
36
+ return response . status === 200 ;
37
37
} ;
38
38
39
- export const ContestUpdatePage = ( props : OuterProps ) => {
39
+ export const ContestUpdatePage = ( props : Props ) => {
40
40
const { contestId } = props ;
41
41
const contestResponse = useVirtualContest ( contestId ) ;
42
- const [ updateResponse , setUpdateResponse ] = React . useState < number > ( ) ;
42
+ const [ updateResponse , setUpdateResponse ] = React . useState < boolean > ( ) ;
43
43
if ( ! contestResponse . data && ! contestResponse . error ) {
44
44
return < Spinner style = { { width : "3rem" , height : "3rem" } } /> ;
45
45
} else if ( contestResponse . error || ! contestResponse . data ) {
@@ -49,7 +49,7 @@ export const ContestUpdatePage = (props: OuterProps) => {
49
49
const contestInfo = contestResponse . data . info ;
50
50
const contestProblems = contestResponse . data . problems ;
51
51
52
- if ( updateResponse === 200 ) {
52
+ if ( updateResponse ) {
53
53
return < Redirect to = { `/contest/show/${ contestId } ` } /> ;
54
54
}
55
55
You can’t perform that action at this time.
0 commit comments