Skip to content
Snippets Groups Projects
Commit 782cc824 authored by Sebastian Karlsson's avatar Sebastian Karlsson
Browse files

Add functionality for refreshing codes

parent 78a08a73
No related branches found
No related tags found
1 merge request!112Add monospace font to competition codes, clean up
...@@ -224,8 +224,16 @@ const CompetitionManager: React.FC = (props: any) => { ...@@ -224,8 +224,16 @@ const CompetitionManager: React.FC = (props: any) => {
dispatch(getCompetitions()) dispatch(getCompetitions())
} }
const doSomething = () => { const refreshCode = async (code: Code) => {
console.log('lol') await axios
.put(`/api/competitions/${activeId}/codes/${code.id}`)
.then(() => {
getCodes()
dispatch(getCompetitions())
})
.catch(({ response }) => {
console.warn(response.data)
})
} }
return ( return (
...@@ -349,7 +357,7 @@ const CompetitionManager: React.FC = (props: any) => { ...@@ -349,7 +357,7 @@ const CompetitionManager: React.FC = (props: any) => {
<Button <Button
margin-right="0px" margin-right="0px"
onClick={() => { onClick={() => {
doSomething() refreshCode(code)
}} }}
> >
<RefreshIcon fontSize="small" /> <RefreshIcon fontSize="small" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment