From 19ef6c19e1ad01f1d575f88365909f101100f2d6 Mon Sep 17 00:00:00 2001 From: Thomas Bouquet <thomas.bouquet@student-cs.fr> Date: Fri, 5 Mar 2021 11:58:24 +0100 Subject: [PATCH] tentative sprint --- front/src/components/Login/SubmitForm.js | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/front/src/components/Login/SubmitForm.js b/front/src/components/Login/SubmitForm.js index 38955282..1748c564 100644 --- a/front/src/components/Login/SubmitForm.js +++ b/front/src/components/Login/SubmitForm.js @@ -1,6 +1,7 @@ import React, { useState, useEffect } from "react"; import { MDBRow, MDBCol, MDBInput, MDBBtn, MDBCard, MDBCardBody, MDBModalFooter, MDBIcon, MDBContainer } from 'mdbreact'; import axios from 'axios'; +import eventData from "../../eventData/eventData.json"; function Submit(props) { @@ -25,6 +26,8 @@ function Submit(props) { }) }*/ + if (Date.now() < 0) { + axios.post('/api/staff/new_score', { score: Math.max(0, props.score), @@ -44,6 +47,30 @@ function Submit(props) { }, (error) => { console.log(error); }) + + } + + else { + axios.post('/api/staff/new_score', + { + score: Math.max(0, props.score), + equipe: props.equipe.value, + participant: "sprint" + }) + .then(() => { + axios.post('/api/staff/new_participant_with_id', + { + id: "sprint", + name: "Sprint" + }) + }) + .then(() => { + alert("Score ajouté"); + window.location = '/Input'; + }, (error) => { + console.log(error); + }) + } }; -- GitLab