File tree Expand file tree Collapse file tree 1 file changed +24
-17
lines changed
Expand file tree Collapse file tree 1 file changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -103,22 +103,29 @@ export function useLastSubmissionForUser(
103103) {
104104 const { token } = useToken ( ) ;
105105
106- return useQuery < { code : string } , Error > ( `last-submission` , async ( ) => {
107- if ( benchmarkId && language ) {
108- const { data } = await axios . put (
109- `${ process . env . REACT_APP_API_ENDPOINT } /submissions` ,
110- {
111- benchmarkId,
112- language,
113- } ,
114- {
115- headers : {
116- Authorization : `Bearer ${ token } ` ,
106+ return useQuery < { code : string } , Error > (
107+ `last-submission` ,
108+ async ( ) => {
109+ if ( benchmarkId && language ) {
110+ const { data } = await axios . put (
111+ `${ process . env . REACT_APP_API_ENDPOINT } /submissions` ,
112+ {
113+ benchmarkId,
114+ language,
117115 } ,
118- } ,
119- ) ;
120- // console.log(data);
121- return data ;
122- }
123- } ) ;
116+ {
117+ headers : {
118+ Authorization : `Bearer ${ token } ` ,
119+ } ,
120+ } ,
121+ ) ;
122+ return data ;
123+ }
124+ } ,
125+ {
126+ retry : false ,
127+ refetchOnReconnect : false ,
128+ refetchOnWindowFocus : false ,
129+ } ,
130+ ) ;
124131}
You can’t perform that action at this time.
0 commit comments