diff --git a/backend/seed.js b/backend/seed.js index e7387c1..ee6ddad 100644 --- a/backend/seed.js +++ b/backend/seed.js @@ -92,15 +92,44 @@ const seed = async () => { await Promise.all(queriesGame); + const sendPlayer = []; + + sendPlayer.push( + database.query( + "insert into player(role_id,username,email,password) values(?,?,?,?)", + [ + 2, + "WildyGamer", + "WildyGamer@gmail.com", + "$argon2id$v=19$m=65536,t=3,p=4$khzdtRAGFeEjX3JOP8ahtQ$sCKskfRURxiMENC8BwuI9UT7om2gvEy+hUwerpNys9k", + ] + ) + ); + await Promise.all(sendPlayer); + + const sendProfil = []; + sendProfil.push( + database.query( + "insert into profile(bio,avatar,alt,player_id) values(?,?,?,?)", + [ + "Titulus voluptatem thesis soleo cupressus voluptatum ad ulciscor absorbeo cursim. Bestia tabella ultio cresco una tepidus ambitus celebrer autem. Vae cedo adiuvo pectus capio suffoco socius suadeo ea.", + "https://avatars.githubusercontent.com/u/40671908", + "via profilwe avatar", + 22, + ] + ) + ); + await Promise.all(sendProfil); + const queryParty = []; - for (let i = 0; i <= 25; i += 1) { + for (let i = 0; i <= 22; i += 1) { const startDate = faker.date.past({ years: 1 }); const d = new Date(startDate); queryParty.push( database.query( "insert into party(player_id,game_id,start_time,end_time,is_won) values (?,?,?,?,?)", [ - Math.ceil(Math.random() * 16), + Math.ceil(Math.random() * 22), Math.ceil(Math.random() * 3), startDate, new Date(d.getTime() + Math.ceil(Math.random() * 45 * 60000)), @@ -123,7 +152,6 @@ const seed = async () => { ); } - // Wait for all the insertion queries to complete await Promise.all(queriesProfile); // requete diff --git a/frontend/src/assets/tictactoe.png b/frontend/src/components/Contact/tictactoe.png similarity index 100% rename from frontend/src/assets/tictactoe.png rename to frontend/src/components/Contact/tictactoe.png diff --git a/frontend/src/components/header/Header.jsx b/frontend/src/components/header/Header.jsx index 327c74c..049f435 100644 --- a/frontend/src/components/header/Header.jsx +++ b/frontend/src/components/header/Header.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Link } from "react-router-dom"; import logo from "../../assets/logo2.png"; import ButtonConected from "../input/ButtonConected"; import InputProfil from "../input/InputProfil"; @@ -7,7 +7,9 @@ import AdminButton from "../input/AdminButton"; function Header() { return (
- logo + + logo + diff --git a/frontend/src/components/profilContainer/Profile.jsx b/frontend/src/components/profilContainer/Profile.jsx index f2e7cb0..9efe91d 100644 --- a/frontend/src/components/profilContainer/Profile.jsx +++ b/frontend/src/components/profilContainer/Profile.jsx @@ -7,7 +7,7 @@ import division from "../../services/divisions"; function ProfilContainer() { const { profil, connected } = useContext(AuthContext); - if (connected && connected.login && connected.login.username) { + if (connected && connected.login && connected.login.username && profil) { return (
@@ -37,6 +37,7 @@ function ProfilContainer() {
); } + return null; } export default ProfilContainer;