|
|
|
@ -16,7 +16,8 @@ export const addXlsFile = async (file: File) => {
|
|
|
|
|
try {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append('file', file);
|
|
|
|
|
const response = await fetch('https://codefirst.iut.uca.fr/containers/enzojolys-r-dash_container/upload', {
|
|
|
|
|
const response = await fetch(
|
|
|
|
|
'https://r-dash.azurewebsites.net/File?' + "pseudoPilote=test_PILOTE" + "&Email=test@gmail.com" + "&password=test123" + "&nameSession=test_SESSION" + "&nameCircuit=test_CIRCUIT" + "&typeSession=Unknown", {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
body: formData
|
|
|
|
|
});
|
|
|
|
@ -27,10 +28,10 @@ export const addXlsFile = async (file: File) => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const getSessionsList = (user: User) => {
|
|
|
|
|
export const getSessionsList = () => {
|
|
|
|
|
return async dispatch => {
|
|
|
|
|
try {
|
|
|
|
|
const sessionsPromise = await fetch('https://codefirst.iut.uca.fr/containers/enzojolys-r-dash_container/Sessions/'+user.getUsername);
|
|
|
|
|
const sessionsPromise = await fetch('https://r-dash.azurewebsites.net/FullSession');
|
|
|
|
|
const sessionsListJson = await sessionsPromise.json();
|
|
|
|
|
const sessionsList: Session[] = sessionsListJson.map(elt => {
|
|
|
|
|
const laps: Lap[] = elt.laps.map(lap => {
|
|
|
|
|