Skip to content
Snippets Groups Projects
Commit 5e8dd6eb authored by Thomas Bouquet's avatar Thomas Bouquet
Browse files

console

parent 2ddc167a
Branches
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import React,{useState,useEffect} from "react";
import { MDBRow, MDBCol, MDBInput, MDBBtn, MDBCard, MDBCardBody, MDBModalFooter, MDBIcon, MDBContainer } from 'mdbreact';
import axios from 'axios';
import AddParticipantIfNotExists from "./Autocomplete/AddParticipantIfNotExists";
import { useIsParticipant } from "../../hooks/authTools";
function Submit (props) {
......@@ -40,19 +41,26 @@ function Submit (props) {
})
};
if (!useIsParticipant(props)){
axios.post('/api/admin/new_participant',
{
id: props.id,
name: props.name
})
.then(() => {
alert("Participant ajouté");
window.location='/Input';
}, (error) => {
console.log(error);
});
};
const onSubmit = () => {addScore()
.then(() => {
AddParticipantIfNotExists(
{
id: 17,
name: props.participant.label
}
);
})};
const onSubmit = () => {addScore()};
return (
<MDBBtn type="submit" icon="send" gradient="blue" rounded disabled={props.unlock} className="btn-block z-depth-1a" onClick={onSubmit}><MDBIcon icon="paper-plane" className="ml-1" /> Envoyer</MDBBtn>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment