diff --git a/front/src/App.js b/front/src/App.js index 0a672274513386d8cac48c18679308bcc402a7e8..03bafa9197ade823e0e1d55cbfc9229933851a56 100644 --- a/front/src/App.js +++ b/front/src/App.js @@ -10,8 +10,8 @@ function App() { <Segment padded style={{margin:"3%"}}> <FormToucan /> </Segment> - <Segment textAlign="center" padded style={{margin:"3%"}}> - <ToucanTable/> + <Segment textAlign="center" padded style={{margin:"3%"}} > + <ToucanTable /> </Segment> </div> ); diff --git a/front/src/FormToucan.js b/front/src/FormToucan.js index 64c713cc17b6b20557f8b54509e36edfbaf3f3d8..a5442ce8c6e052e036610880cb52e9090b29e8fd 100644 --- a/front/src/FormToucan.js +++ b/front/src/FormToucan.js @@ -31,7 +31,6 @@ class FormToucan extends Component { } onToucanChange = (e) => { - console.log(e.target); const file = e.target.files[0]; if (file.type === 'application/pdf') { // Si on a bien un pdf @@ -50,7 +49,7 @@ class FormToucan extends Component { onDateChange = (event,{value}) =>{ let [day,month,year] = value.split("-") - this.setState({date: new Date(Date.UTC(year,month-1,day,0,0,0))},()=> console.log(this.state.date.toLocaleDateString())); + this.setState({date: new Date(Date.UTC(year,month-1,day,0,0,0))}); } onSubmit = () => { @@ -66,12 +65,11 @@ class FormToucan extends Component { method: 'POST', body: form }) - .then((msg)=>console.log(msg)) + .then(() => window.location.reload()) .catch((err)=>console.log(err)) } render() { - const errorMessage = []; if (this.state.titleError) { errorMessage.push("Le thème doit faire entre 1 et 60 caractères, les caractères spéciaux ($ € { } [ ] ... ) ne sont pas autorisés") @@ -122,7 +120,6 @@ class FormToucan extends Component { {errorMessage.map((err) => {return <li>{err}</li>})} </ul> } /> - <Form.Button disabled={formError} content="C'est parti !" /> </Form> ) diff --git a/front/src/ModalSuppression.js b/front/src/ModalSuppression.js index 424c11472e241c9e2be62c174a778e7d889d8e06..0a75ae170d289af16b9507e7214d5dddf3ece280 100644 --- a/front/src/ModalSuppression.js +++ b/front/src/ModalSuppression.js @@ -7,7 +7,8 @@ class ModalSupression extends Component { fetch(`${env.backURL}/toucan/delete/${id}`,{ method: "Post" }) - .then(this.props.closeModal()) + .then(() => window.location.reload()) + .catch(err => console.log(err)) } render() { diff --git a/front/src/ToucanTable.js b/front/src/ToucanTable.js index 7780444684c80762d30265de68a76a7e2e715dca..39d2841fcf60d48a2e9498a99a66ef27a9a080af 100644 --- a/front/src/ToucanTable.js +++ b/front/src/ToucanTable.js @@ -14,14 +14,12 @@ class ToucanTable extends Component{ componentDidMount(){ fetch(`${env.backURL}/toucan/toucans`) .then(result => { - console.log(result) return result.json() }) .then(toucans => { - console.log(toucans) - this.setState({toucans}) + this.setState({toucans}) }) - .catch(err => console.log(err)) + .catch(err => console.log(err)) } render() {