fixed the bugs that get all the team instead of the users ones + format
continuous-integration/drone/push Build is passing Details

pull/92/head
Maël DAIM 1 year ago
parent 0aa7ad6ba2
commit fc25ddff4c

@ -32,7 +32,7 @@ import { CourtAction } from "./editor/CourtAction"
import { BasketCourt } from "../components/editor/BasketCourt" import { BasketCourt } from "../components/editor/BasketCourt"
import { ratioWithinBase } from "../components/arrows/Pos" import { ratioWithinBase } from "../components/arrows/Pos"
import { Action, ActionKind } from "../model/tactic/Action" import { Action, ActionKind } from "../model/tactic/Action"
import {BASE} from "../Constants"; import { BASE } from "../Constants"
const ERROR_STYLE: CSSProperties = { const ERROR_STYLE: CSSProperties = {
borderColor: "red", borderColor: "red",
@ -399,7 +399,7 @@ function EditorView({
Home Home
</button> </button>
<div id="topbar-left"> <div id="topbar-left">
<SavingState state={saveState}/> <SavingState state={saveState} />
</div> </div>
<div id="title-input-div"> <div id="title-input-div">
<TitleInput <TitleInput

@ -1,8 +1,8 @@
import "../style/home/home.css" import "../style/home/home.css"
// import AccountSvg from "../assets/account.svg?react" // import AccountSvg from "../assets/account.svg?react"
import {Header} from "./template/Header" import { Header } from "./template/Header"
import {BASE} from "../Constants"; import { BASE } from "../Constants"
interface Tactic { interface Tactic {
id: number id: number

@ -1,4 +1,4 @@
import {BASE} from "../../Constants"; import { BASE } from "../../Constants"
/** /**
* *

@ -123,13 +123,19 @@ class TeamGateway {
); );
} }
/** /**
* Get all the user's teams * @param int $user
* @param integer $user * @return array<string, mixed>
* @return array<array<string, mixed>>
*/ */
public function getAll(int $user): array { public function getAll(int $user): array {
return $this->con->fetch("SELECT * FROM Team", []); return $this->con->fetch(
"SELECT t.* FROM team t,Member m WHERE m.id_team = t.id AND m.id_user= :idUser ",
[
"idUser" => [$user, PDO::PARAM_INT],
]
);
} }
} }

Loading…
Cancel
Save