diff --git a/back/src/controllers/participant.controller.js b/back/src/controllers/participant.controller.js index 42c259b1dcb05322950ad735ea9a2613a39ade5b..994caf19f4bf9cc88e288206250d00381d72792e 100644 --- a/back/src/controllers/participant.controller.js +++ b/back/src/controllers/participant.controller.js @@ -15,7 +15,7 @@ const dbConfig = { function getClassementIndividuel(req, res) { var con = mysql.createConnection(dbConfig); - var query = "SELECT Participant.id as id, Participant.name as name, score, Equipe.name AS equipe_name FROM Score JOIN Participant ON Participant.id=Score.participantId JOIN Equipe ON Score.equipeId = Equipe.id WHERE (Score.deleted = 0 AND Participant.deleted=0 AND Participant.id != 'sprint') ORDER BY score DESC;" + var query = "SELECT Participant.id as id, Participant.name as name, score, Equipe.name AS equipe_name FROM Score JOIN Participant ON Participant.id=Score.participantId JOIN Equipe ON Score.equipeId = Equipe.id WHERE Score.deleted = 0 AND Participant.deleted=0 ORDER BY score DESC;" con.connect(); con.query(query, (err, result) => { if (err) { diff --git a/front/src/components/Login/SubmitForm.js b/front/src/components/Login/SubmitForm.js index 1c274a17189f82bce8b88326987e599043a94e1c..389552824cadb5ad1d22c15b4f0aed183d5bdac1 100644 --- a/front/src/components/Login/SubmitForm.js +++ b/front/src/components/Login/SubmitForm.js @@ -1,13 +1,9 @@ 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) { - const now = Date.now() < 0; - console.log(now); - /*var [participants,setParticipants] = useState([]); useEffect(() => { const interval = setInterval(() => { @@ -29,8 +25,6 @@ function Submit(props) { }) }*/ - if (now < 0) { - axios.post('/api/staff/new_score', { score: Math.max(0, props.score), @@ -50,30 +44,6 @@ 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); - }) - } };