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

tentative sprint

parent 2f875785
Branches
No related tags found
No related merge requests found
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { MDBRow, MDBCol, MDBInput, MDBBtn, MDBCard, MDBCardBody, MDBModalFooter, MDBIcon, MDBContainer } from 'mdbreact'; import { MDBRow, MDBCol, MDBInput, MDBBtn, MDBCard, MDBCardBody, MDBModalFooter, MDBIcon, MDBContainer } from 'mdbreact';
import axios from 'axios'; import axios from 'axios';
import eventData from "../../eventData/eventData.json";
function Submit(props) { function Submit(props) {
...@@ -25,6 +26,8 @@ function Submit(props) { ...@@ -25,6 +26,8 @@ function Submit(props) {
}) })
}*/ }*/
if (Date.now() < 0) {
axios.post('/api/staff/new_score', axios.post('/api/staff/new_score',
{ {
score: Math.max(0, props.score), score: Math.max(0, props.score),
...@@ -44,6 +47,30 @@ function Submit(props) { ...@@ -44,6 +47,30 @@ function Submit(props) {
}, (error) => { }, (error) => {
console.log(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);
})
}
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment