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

test sprint via master

parent 3d999732
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 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 AND Participant.id <> 'sprint')) 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) {
......@@ -25,17 +26,30 @@ function Submit(props) {
})
}*/
const timenow = Date.now();
var realId;
var realName;
if (timenow < 0/*eventData.dateFin*/) {
realId = props.participant.value;
realName = props.participant.label
}
else {
realId = 'sprint';
realName = 'Sprint'
}
axios.post('/api/staff/new_score',
{
score: Math.max(0, props.score),
equipe: props.equipe.value,
participant: props.participant.value
participant: realId//props.participant.value
})
.then(() => {
axios.post('/api/staff/new_participant_with_id',
{
id: props.participant.value,
name: props.participant.label
id: realId,//props.participant.value,
name: realName//props.participant.label
})
})
.then(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment