Clean up
This commit is contained in:
parent
fdb1a32aa3
commit
53f44ed5a0
|
@ -80,12 +80,6 @@ let submitChanges = curryTournamentId => event => {
|
||||||
let deleteTournament = tournamentId => event => {
|
let deleteTournament = tournamentId => event => {
|
||||||
console.log(tournamentId);
|
console.log(tournamentId);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
//TODO: https://mui.com/components/dialogs/
|
|
||||||
|
|
||||||
// let certain = window.confirm("Are you sure? Click OK to delete tournament");
|
|
||||||
// if (!certain) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
fetch(process.env.REACT_APP_API_URL + `/tournament/${tournamentId}`, {
|
fetch(process.env.REACT_APP_API_URL + `/tournament/${tournamentId}`, {
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
|
@ -197,15 +191,15 @@ function ConfirmationDialogRaw(props) {
|
||||||
open={open}
|
open={open}
|
||||||
{...other}
|
{...other}
|
||||||
>
|
>
|
||||||
<DialogTitle>Yes or No</DialogTitle>
|
<DialogTitle>Delete tournament?</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
Test
|
Are you sure you want to delete the tournament? This action is not reversible!
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button autoFocus onClick={handleCancel}>
|
<Button autoFocus onClick={handleCancel}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={deleteTournament(tournamentId)}>Ok</Button>
|
<Button onClick={deleteTournament(tournamentId)}>Confirm</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
@ -252,28 +246,6 @@ export default function TournamentManager(props) {
|
||||||
</Box>
|
</Box>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
{/* <Dialog
|
|
||||||
open={open}
|
|
||||||
onClose={handleClose}
|
|
||||||
aria-labelledby="alert-dialog-title"
|
|
||||||
aria-describedby="alert-dialog-description"
|
|
||||||
>
|
|
||||||
<DialogTitle id="alert-dialog-title">
|
|
||||||
{"Delete Tournament?"}
|
|
||||||
</DialogTitle>
|
|
||||||
<DialogContent>
|
|
||||||
<DialogContentText id="alert-dialog-description">
|
|
||||||
Are you sure? Click Confirm to delete tournament
|
|
||||||
</DialogContentText>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<Button onClick={handleClose}>Cancel</Button>
|
|
||||||
<Button onClick={handleConfirm} autoFocus>
|
|
||||||
Confirm
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</Dialog> */}
|
|
||||||
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue