diff --git a/backend/src/controllers/team-contorller.ts b/backend/src/controllers/team-contorller.ts index ba4c3f8..677ae13 100644 --- a/backend/src/controllers/team-contorller.ts +++ b/backend/src/controllers/team-contorller.ts @@ -56,7 +56,7 @@ const TeamController = { try { const teamRepository = getCustomRepository(TeamRepository); const team = await teamRepository.read(req.params.teamId); - res.status(200).send(team[0]); + res.status(200).send(team); } catch (err) { res.sendStatus(409); } diff --git a/backend/src/repositories/team-repository.ts b/backend/src/repositories/team-repository.ts index 70166ba..f195ae4 100644 --- a/backend/src/repositories/team-repository.ts +++ b/backend/src/repositories/team-repository.ts @@ -13,14 +13,12 @@ export default class TeamRepository extends AbstractRepository { return insertResult.raw.insertId; } - async read(team_id: number) { - console.log(team_id); + async read(teamId: number) { const result = await this.repository .createQueryBuilder('team') .select() - .where(`team_id = :team_id`, { team_id }) - .execute(); - console.log(result); + .where(`team_id=:id`, { id: teamId }) + .getOne(); return result; } diff --git a/frontend/src/components/Users/UsersHeader/index.tsx b/frontend/src/components/Users/UsersHeader/index.tsx index cfe5a84..a5db6fc 100644 --- a/frontend/src/components/Users/UsersHeader/index.tsx +++ b/frontend/src/components/Users/UsersHeader/index.tsx @@ -12,8 +12,8 @@ const UsersHeader: React.FC = ({ teamId }) => { const teamInfo = useRecoilValue(teamInfoSelector(teamId)); return ( - - {teamInfo?.team_name} + + {teamInfo.team_name} ); };