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

Nope

parent 28b2fb83
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
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);
})
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment