Skip to content

Commit 34d0d1e

Browse files
committed
ajustement de la page voir mes équipes et modifications de la gestion admin
1 parent 38b5744 commit 34d0d1e

7 files changed

Lines changed: 1676 additions & 1850 deletions

File tree

api_backend/controller/controller.team.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Team from "../models/team.model.js";
22
import {User} from "../models/user.model.js";
33

4+
45
export const getTeams = async (req, res) => {
56

67
try{
@@ -125,7 +126,14 @@ export const updateTeam = async (req, res) => {
125126
export const getTeamById = async (req, res) => {
126127
const { id } = req.params;
127128
try {
128-
const team = await Team.findById(id).populate('joueurs');
129+
const team = await Team.findById(id)
130+
.populate({
131+
path: 'joueurs',
132+
populate: {
133+
path: 'ecole_id',
134+
select: 'nom'
135+
}
136+
});
129137

130138
if (!team) {
131139
return res.status(404).json({ success: false, message: "Équipe introuvable" });
@@ -137,3 +145,5 @@ export const getTeamById = async (req, res) => {
137145
res.status(500).json({ success: false, message: "Erreur serveur" });
138146
}
139147
};
148+
149+

api_backend/controllers/auth.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const signup = async (req, res) => {
7474
//jwt
7575
generateTokenAndSetCookie(res, user._id);
7676

77-
await sendVerificationEmail(user.email, verificationToken);
77+
// await sendVerificationEmail(user.email, verificationToken);
7878

7979
res.status(201).json({
8080
sucess: true,

api_backend/package-lock.json

Lines changed: 27 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_frontend/.env

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
PORT=5000
2+
MONGO_URI='mongodb+srv://raisuca123:Raisa215@cluster0.vj5aw.mongodb.net/RDI25'
3+
CLIENT_URL = "http://localhost:3000"
4+
VITE_API = "http://localhost:5000"
5+
6+
JWT_SECRET='hassanLeBGS'
7+
NODE_ENV = "developement"
8+
9+
MAILTRAP_TOKEN = "df2abcc24a2689ee1d54a6e9c014990d"
10+
MAILTRAP_ENDPOINT = "sandbox.smtp.mailtrap.io/"
11+
12+
CLOUDINARY_CLOUD_NAME=dorp6t0ni
13+
CLOUDINARY_API_KEY=323855237665552
14+
CLOUDINARY_API_SECRET=oUaA4ZtJhs_gbsXYfVLELyAq6IE

0 commit comments

Comments
 (0)