27 Achegas 5bb570bbdf ... 54ac05b4c1

Autor SHA1 Mensaxe Data
  jax 54ac05b4c1 同步main分支 hai 10 meses
  jax 1626b0451b Merge remote-tracking branch 'origin/main' into lvyin hai 10 meses
  jax 5b4e69fa49 预测记录重复问题修复 hai 10 meses
  jax 5cbfd136e6 拒绝逻辑修改 hai 10 meses
  jax 36038a3c4f 增加monodb索引 hai 10 meses
  jax b1520a4626 问题修复 hai 10 meses
  jax 76e278f547 配置文件提交 hai 10 meses
  jax 0a9cf173a6 提交yarn文件 hai 10 meses
  jax 844be1c6c9 删除无用的js hai 10 meses
  jax 547aa8c1cf 更新dockerfile hai 10 meses
  jax 1645da289d 补充 hai 10 meses
  jax 22c96740f6 修改,总进球数结算问题 hai 10 meses
  jax e0db9621c6 fix 未登录时提示语修改 hai 10 meses
  charles_c 62d999a3cf 背景弹窗 hai 10 meses
  charles_c e4a0e33777 篮球预测记录 hai 10 meses
  charles_c 780eeee295 2小时后自动结束 hai 10 meses
  charles_c bd9afc5cd3 1 hai 10 meses
  charles_c 35b20aa5e2 1 hai 10 meses
  charles_c 465584c9dc 1 hai 10 meses
  charles_c 40b2ca0ef3 1 hai 10 meses
  charles_c 87dbbf5b68 token和篮球比赛预测 hai 10 meses
  charles_c b94ce196bd 一键清理 hai 10 meses
  charles_c 6e1d8525b1 一键清理 hai 10 meses
  charles_c fcb7deeeb7 1 hai 10 meses
  charles_c c998ba560f 1 hai 10 meses
  charles_c 0548e13170 积分兑换规则 hai 10 meses
  charles_c da8f6fbe03 MONGODB_URI hai 11 meses

+ 17 - 0
.vscode/launch.json

@@ -0,0 +1,17 @@
+{
+    // 使用 IntelliSense 了解相关属性。 
+    // 悬停以查看现有属性的描述。
+    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "type": "node",
+            "request": "launch",
+            "name": "启动程序",
+            "skipFiles": [
+                "<node_internals>/**"
+            ],
+            "program": "${file}"
+        }
+    ]
+}

BIN=BIN
public/images/login_logo.jpg


+ 0 - 2
src/app/api/activity/route.js

@@ -10,8 +10,6 @@ export async function GET(request) {
   try {
     const isFromFrontend = request.headers.get("x-from-frontend") === "true";
 
-    console.log("isFromFrontend", isFromFrontend);
-
     let activities;
     let message;
 

+ 42 - 10
src/app/api/exchange-history/route.js

@@ -9,7 +9,7 @@ import { withAuth } from "../../middleware/authMiddleware";
 
 export const GET = withAuth(async (request) => {
   await dbConnect();
-  console.log("GET请求已接收");
+
   try {
     const { searchParams } = new URL(request.url);
     let query = {};
@@ -52,9 +52,6 @@ export const GET = withAuth(async (request) => {
       }
     }
 
-    console.log("Query:", query);
-    console.log("Item Query:", itemQuery);
-
     // 首先查找符合条件的 ExchangeItem
     const matchedItems = await ExchangeItem.find(itemQuery).select("_id");
     const itemIds = matchedItems.map((item) => item._id);
@@ -67,7 +64,7 @@ export const GET = withAuth(async (request) => {
     const exchangeHistories = await ExchangeHistory.find(query).populate(
       "item",
       "title type points"
-    );
+    ).sort({ createdAt: -1 });
 
     const message =
       exchangeHistories.length > 0
@@ -137,6 +134,7 @@ export const POST = withAuth(async (request) => {
       username,
       item,
       status,
+      pointsToDeduct,
       exchangeInfo,
       exchangeTime,
       exchangeCount,
@@ -186,7 +184,43 @@ export const PUT = withAuth(async (request) => {
   await dbConnect();
   try {
     const { id, ...updateData } = await request.json();
-    console.log(id, updateData);
+
+    const response = NextResponse.json(
+      { success: true, data: null },
+      { status: 200 }
+    );
+
+    //如果是拒绝
+    if (updateData?.status == '拒绝') {
+      const exchangeHistory = await ExchangeHistory.findById(id);
+      if (!exchangeHistory) {
+        return NextResponse.json(
+          { success: false, error: "未找到兑换历史" },
+          { status: 404 }
+        );
+      }
+
+      const exchangeItem = await ExchangeItem.findById(exchangeHistory.item);
+      // 更新用户积分
+      const updatedUser = await User.findByIdAndUpdate(
+        exchangeHistory.userId,
+        { $inc: { points: +exchangeItem.points } },
+        { new: true, runValidators: true }
+      );
+
+      if (!updatedUser) {
+        throw new Error("更新用户积分失败");
+      }
+      // 创建积分加减历史记录
+      const reason = `返还: ${exchangeItem.title.replace(/<[^>]*>/g, "").trim()} 积分`;
+      const pointHistory = new PointHistory({
+        user: updatedUser._id,
+        points: +exchangeItem.points,
+        reason: reason,
+      });
+      await pointHistory.save();
+
+    }
     const updatedExchangeHistory = await ExchangeHistory.findByIdAndUpdate(
       id,
       updateData,
@@ -200,11 +234,9 @@ export const PUT = withAuth(async (request) => {
         { success: false, error: "未找到兑换历史" },
         { status: 404 }
       );
+
     }
-    const response = NextResponse.json(
-      { success: true, data: updatedExchangeHistory },
-      { status: 200 }
-    );
+
     return setCORSHeaders(response);
   } catch (error) {
     return handleError(error);

+ 2 - 4
src/app/api/match/route.js

@@ -86,7 +86,7 @@ export async function GET(request) {
           }
         }
 
-        console.log("Search Query:", searchQuery);
+        // console.log("Search Query:", searchQuery);
 
         // await Promise.all([
         //   // 更新所有开始超过2小时的比赛为已结束
@@ -130,7 +130,7 @@ export async function GET(request) {
         const skip = (current - 1) * pageSize;
         const totalMatches = await Match.countDocuments(searchQuery);
         const matchesData = await Match.find(searchQuery)
-          .sort({ date: 1, time: 1 })
+          .sort({ date: -1, time: -1 })
           .skip(skip)
           .limit(pageSize);
 
@@ -304,8 +304,6 @@ export const DELETE = withAuth(async (request) => {
     const id = url.searchParams.get("id");
     const ids = url.searchParams.get("ids");
 
-    console.log("Received delete request for id:", id, "or ids:", ids);
-
     if (!id && !ids) {
       return NextResponse.json(
         { success: false, error: "缺少比赛ID" },

+ 0 - 2
src/app/api/new-activities/route.js

@@ -10,8 +10,6 @@ export async function GET(request) {
   try {
     const isFromFrontend = request.headers.get("x-from-frontend") === "true";
 
-    console.log("isFromFrontend", isFromFrontend);
-
     let activities;
     let message;
 

+ 7 - 6
src/app/api/point-history/route.js

@@ -113,11 +113,14 @@ export const GET = withAuth(async (request) => {
         case "reason":
           searchQuery.reason = { $regex: value, $options: "i" };
           break;
-        case "dateRange":
-          const [startDate, endDate] = value.split(",");
+        case "startExchangeTime":
           searchQuery.createdAt = {
-            $gte: new Date(startDate),
-            $lte: new Date(endDate),
+            $gte: new Date(value),
+          };
+          break;
+        case "endExchangeTime":
+          searchQuery.createdAt = {
+            $lte: new Date(value),
           };
           break;
         case "id":
@@ -126,8 +129,6 @@ export const GET = withAuth(async (request) => {
       }
     }
 
-    console.log("Search Query:", searchQuery);
-
     const total = await PointHistory.countDocuments(searchQuery);
     const history = await PointHistory.find(searchQuery)
       .sort({ createdAt: -1 })

+ 69 - 56
src/app/api/prediction/route.js

@@ -11,7 +11,8 @@ export const GET = withAuth(async (request) => {
     const { searchParams } = new URL(request.url);
     const current = parseInt(searchParams.get("current") || "1");
     const pageSize = parseInt(searchParams.get("pageSize") || "10");
-    const matchInfo = searchParams.get("matchInfo");
+    const homeTeam = searchParams.get("homeTeam");
+    const awayTeam = searchParams.get("awayTeam");
     const username = searchParams.get("username");
     const type = searchParams.get("type"); // 新增type参数来筛选运动类型
 
@@ -29,7 +30,7 @@ export const GET = withAuth(async (request) => {
     // 处理其他搜索参数
     for (const [key, value] of searchParams.entries()) {
       if (
-        ["current", "pageSize", "matchInfo", "username", "type"].includes(key)
+        ["current", "pageSize", "homeTeam", "awayTeam", "username", "type"].includes(key)
       )
         continue;
 
@@ -109,30 +110,25 @@ export const GET = withAuth(async (request) => {
           userInfo: 0,
         },
       },
-      { $sort: { createdAt: -1 } },
+      { $sort: { matchTime: -1 } },
     ];
 
-    if (matchInfo) {
+    if (homeTeam) {
       pipeline.push({
         $match: {
-          $or: [
-            {
-              "matchDetails.homeTeam.name": {
-                $regex: matchInfo,
-                $options: "i",
-              },
-            },
-            {
-              "matchDetails.awayTeam.name": {
-                $regex: matchInfo,
-                $options: "i",
-              },
-            },
-          ],
+          "matchDetails.homeTeam.name": homeTeam,
+        },
+      });
+    }
+    if (awayTeam) {
+      pipeline.push({
+        $match: {
+          "matchDetails.awayTeam.name": awayTeam,
         },
       });
     }
 
+
     const countPipeline = [...pipeline, { $count: "total" }];
     const totalResult = await Prediction.aggregate(countPipeline);
     const totalCount = totalResult.length > 0 ? totalResult[0].total : 0;
@@ -152,7 +148,8 @@ export const GET = withAuth(async (request) => {
           ...prediction,
           match: undefined,
           matchDetails: undefined,
-          matchInfo: `${prediction.matchDetails.homeTeam.name}:${prediction.matchDetails.awayTeam.name}`,
+          homeTeam: prediction.matchDetails.homeTeam.name,
+          awayTeam: prediction.matchDetails.awayTeam.name
         };
 
         // 根据运动类型添加特定信息
@@ -194,8 +191,6 @@ export const POST = withAuth(async (request) => {
     const body = await request.json();
     const { userId, predictions } = body;
 
-    console.log(111, userId, predictions);
-
     if (!userId) {
       return NextResponse.json(
         { success: false, error: "请先登录" },
@@ -224,8 +219,11 @@ export const POST = withAuth(async (request) => {
         match: matchId,
       });
 
-      console.log(111, pred, matchId);
-      console.log("existingPrediction", existingPrediction);
+      const filter = {
+        user: userId,
+        match: matchId,
+      };
+
 
       if (existingPrediction) {
         // 更新预测
@@ -247,7 +245,6 @@ export const POST = withAuth(async (request) => {
               football.totalGoals.prediction;
           }
         } else if (type === "basketball" && basketball) {
-          console.log(222);
 
           if (basketball.whoWillWin) {
             existingPrediction.basketball.whoWillWin.prediction =
@@ -263,7 +260,15 @@ export const POST = withAuth(async (request) => {
           }
         }
 
-        const updatedPrediction = await existingPrediction.save();
+        // const updatedPrediction = await existingPrediction.save();
+        const updatedPrediction = await Prediction.findOneAndUpdate(
+          filter,
+          existingPrediction,
+          {
+            new: true,       // 返回更新后的数据
+            upsert: false,   // 不存在则不创建新记录
+          }
+        );
         createdPredictions.push(updatedPrediction);
       } else {
         // 创建新预测
@@ -273,27 +278,35 @@ export const POST = withAuth(async (request) => {
           type,
           ...(type === "football" &&
             football && {
-              football: {
-                whoWillWin: { prediction: football.whoWillWin.prediction },
-                firstTeamToScore: {
-                  prediction: football.firstTeamToScore.prediction,
-                  firstTeamToScoreLogo:
-                    football.firstTeamToScore.firstTeamToScoreLogo,
-                },
-                totalGoals: { prediction: football.totalGoals.prediction },
+            football: {
+              whoWillWin: { prediction: football.whoWillWin.prediction },
+              firstTeamToScore: {
+                prediction: football.firstTeamToScore.prediction,
+                firstTeamToScoreLogo:
+                  football.firstTeamToScore.firstTeamToScoreLogo,
               },
-            }),
+              totalGoals: { prediction: football.totalGoals.prediction },
+            },
+          }),
           ...(type === "basketball" &&
             basketball && {
-              basketball: {
-                whoWillWin: { prediction: basketball.whoWillWin.prediction },
-                spread: { prediction: basketball.spread.prediction },
-                totalPoints: { prediction: basketball.totalPoints.prediction },
-              },
-            }),
+            basketball: {
+              whoWillWin: { prediction: basketball.whoWillWin.prediction },
+              spread: { prediction: basketball.spread.prediction },
+              totalPoints: { prediction: basketball.totalPoints.prediction },
+            },
+          }),
         });
 
-        const savedPrediction = await newPrediction.save();
+        // const savedPrediction = await newPrediction.save();
+        const savedPrediction = await Prediction.findOneAndUpdate(
+          filter,
+          newPrediction,
+          {
+            new: true,          // 返回更新后的数据
+            upsert: true,       // 如果不存在则创建新记录
+            setDefaultsOnInsert: true, // 在插入新记录时,应用模式中的默认值
+          });
         createdPredictions.push(savedPrediction);
       }
     }
@@ -323,24 +336,24 @@ export const PUT = withAuth(async (request) => {
       type,
       ...(type === "football" &&
         football && {
-          football: {
-            whoWillWin: { prediction: football.whoWillWin.prediction },
-            firstTeamToScore: {
-              prediction: football.firstTeamToScore.prediction,
-              firstTeamToScoreLogo:
-                football.firstTeamToScore.firstTeamToScoreLogo,
-            },
-            totalGoals: { prediction: football.totalGoals.prediction },
+        football: {
+          whoWillWin: { prediction: football.whoWillWin.prediction },
+          firstTeamToScore: {
+            prediction: football.firstTeamToScore.prediction,
+            firstTeamToScoreLogo:
+              football.firstTeamToScore.firstTeamToScoreLogo,
           },
-        }),
+          totalGoals: { prediction: football.totalGoals.prediction },
+        },
+      }),
       ...(type === "basketball" &&
         basketball && {
-          basketball: {
-            whoWillWin: { prediction: basketball.whoWillWin.prediction },
-            spread: { prediction: basketball.spread.prediction },
-            totalPoints: { prediction: basketball.totalPoints.prediction },
-          },
-        }),
+        basketball: {
+          whoWillWin: { prediction: basketball.whoWillWin.prediction },
+          spread: { prediction: basketball.spread.prediction },
+          totalPoints: { prediction: basketball.totalPoints.prediction },
+        },
+      }),
     };
 
     const updatedPrediction = await Prediction.findByIdAndUpdate(

+ 7 - 6
src/app/api/updateForMatch/route.js

@@ -91,12 +91,13 @@ export const POST = withAuth(async (request) => {
         const spreadPoints = match.basketball.spread.points;
         const spreadFavorite = match.basketball.spread.favorite;
 
-        let homeScoreWithSpread =
-          spreadFavorite === "home"
-            ? homeScore - spreadPoints
-            : homeScore + spreadPoints;
-
-        const spreadResult = homeScoreWithSpread > awayScore ? "home" : "away";
+        let spreadResult;
+        //主队让分
+        if (spreadFavorite === "home") {
+          spreadResult = homeScore - spreadPoints > awayScore ? "home" : "away";
+        } else if (spreadFavorite === "away") { //客队让分
+          spreadResult = awayScore - spreadPoints > homeScore ? "away" : "home";
+        }
 
         if (prediction.basketball?.spread?.prediction == spreadResult) {
           prediction.basketball.spread.result = "correct";

+ 23 - 4
src/app/api/user/route.js

@@ -29,7 +29,7 @@ export const GET = withAuth(async (request) => {
     }
 
     const searchQuery = {};
-
+    let sortParams = {};
     for (const [key, value] of searchParams.entries()) {
       if (["current", "pageSize"].includes(key)) continue;
 
@@ -54,14 +54,26 @@ export const GET = withAuth(async (request) => {
         case "id":
           searchQuery._id = value;
           break;
+        case "sort":
+          if (value && value != '{}') {
+            const sortObj = JSON.parse(value);
+            const sortField = Object.keys(sortObj)[0]; // 获取字段名,例如 'points'
+            if (sortObj[sortField] === "ascend") {
+              sortParams[sortField] = 1; // 升序
+            } else {
+              sortParams[sortField] = -1; // 降序
+            }
+          }
+          break;
       }
     }
 
-    console.log("Search Query:", searchQuery);
 
     const skip = (current - 1) * pageSize;
     const totalUsers = await User.countDocuments(searchQuery);
-    const usersData = await User.aggregate([
+
+    // 构建聚合管道
+    const pipeline = [
       { $match: searchQuery },
       { $project: { password: 0 } },
       {
@@ -74,7 +86,14 @@ export const GET = withAuth(async (request) => {
       { $sort: { sortOrder: 1, createdAt: -1 } },
       { $skip: skip },
       { $limit: pageSize },
-    ]);
+    ];
+
+
+    if (Object.keys(sortParams).length > 0) {
+      pipeline.splice(3, 1, { $sort: { ...sortParams } });
+    }
+
+    const usersData = await User.aggregate(pipeline);
 
     const response = NextResponse.json({
       success: true,

+ 3 - 1
src/app/exchange-points/ExchangeForm.jsx

@@ -47,7 +47,7 @@ export default function ExchangeForm({
         // exchangeCount: formData.exchangeCount || 1,
       };
 
-      console.log("params", params);
+      // console.log("params", params);
 
       const res = await fetchApi("/api/exchange-history", {
         method: "POST",
@@ -67,6 +67,8 @@ export default function ExchangeForm({
         };
         localStorage.setItem("currentUser", JSON.stringify(updatedUser));
         setCurrentUser(updatedUser);
+
+
       } else {
         setAlert({ type: "error", message: res.error });
       }

+ 6 - 7
src/app/exchange-points/page.js

@@ -269,15 +269,14 @@ export default function ExchangePage() {
                         }}
                       ></p>
                       <p
-                        className={`text-sm font-medium ${
-                          exchange.status === "待兑换已审核"
+                        className={`text-sm font-medium ${exchange.status === "待兑换已审核"
                             ? "text-blue-600"
                             : exchange.status === "待兑换未审核"
-                            ? "text-gray-600"
-                            : exchange.status === "已兑换"
-                            ? "text-green-600"
-                            : "text-gray-600"
-                        }`}
+                              ? "text-gray-600"
+                              : exchange.status === "已兑换"
+                                ? "text-green-600"
+                                : "text-gray-600"
+                          }`}
                       >
                         {exchange.status}
                       </p>

+ 7 - 7
src/app/login/page.js

@@ -48,13 +48,13 @@ export default function LoginPage() {
       </Head>
 
       {/* 背景图片 */}
-      {/* <div className="absolute inset-0 flex">
-        <img
-          src="https://007xagm5vezzk-fluid-aliyun.erzjzd.com/assets/bd7-bg_mobile@3x-0648c73a.png"
-          alt="背景图片"
-          className="object-cover"
-        />
-      </div> */}
+      {/*<div className="absolute inset-0 flex">*/}
+      {/*  <img*/}
+      {/*    src="./images/login_logo.jpg"*/}
+      {/*    alt="背景图片"*/}
+      {/*    className="object-cover"*/}
+      {/*  />*/}
+      {/*</div>*/}
 
       {/* 登录表单 */}
       <div className="mt-80 relative w-full max-w-md mx-auto z-10 bg-opacity-80 bg-white rounded-lg shadow">

+ 6 - 1
src/app/models/ExchangeHistory.js

@@ -18,9 +18,10 @@ const ExchangeHistorySchema = new mongoose.Schema(
     },
     status: {
       type: String,
-      enum: ["待兑换未审核", "待兑换已审核", "已兑换"],
+      enum: ["待兑换未审核", "待兑换已审核", "已兑换", "拒绝"],
       default: "待兑换未审核",
     },
+    points: { type: Number, default: 0 },
     exchangeInfo: {
       account: { type: String },
       name: { type: String },
@@ -33,5 +34,9 @@ const ExchangeHistorySchema = new mongoose.Schema(
   { timestamps: true }
 );
 
+ExchangeHistorySchema.index({ "userId": 1 }); // userId 索引
+ExchangeHistorySchema.index({ "username": 1 }); // username 索引
+ExchangeHistorySchema.index({ "createdAt": 1 }); // createdAt 索引
+
 export default mongoose.models.ExchangeHistory ||
   mongoose.model("ExchangeHistory", ExchangeHistorySchema);

+ 4 - 0
src/app/models/Match.js

@@ -83,4 +83,8 @@ const MatchSchema = new mongoose.Schema(
   { timestamps: true }
 );
 
+MatchSchema.index({ "homeTeam.name": 1 }); // homeTeam.name 索引
+MatchSchema.index({ "awayTeam.name": 1 }); // awayTeam.name 索引
+MatchSchema.index({ date: 1 }); // 按照比赛日期索引
+
 export default mongoose.models.Match || mongoose.model("Match", MatchSchema);

+ 3 - 0
src/app/models/PointHistory.js

@@ -10,5 +10,8 @@ const PointHistorySchema = new mongoose.Schema(
   { timestamps: true }
 );
 
+PointHistorySchema.index({ "user": 1 }); // user 索引
+PointHistorySchema.index({ "match": 1 }); // match 索引
+
 export default mongoose.models.PointHistory ||
   mongoose.model("PointHistory", PointHistorySchema);

+ 4 - 0
src/app/models/Prediction.js

@@ -88,5 +88,9 @@ const PredictionSchema = new mongoose.Schema(
   { timestamps: true }
 );
 
+PredictionSchema.index({ "user": 1 }); // user 索引
+PredictionSchema.index({ "match": 1 }); // match 索引
+PredictionSchema.index({ user: 1, match: 1 }, { unique: true });
+
 export default mongoose.models.Prediction ||
   mongoose.model("Prediction", PredictionSchema);

+ 2 - 0
src/app/models/User.js

@@ -28,4 +28,6 @@ const UserSchema = new mongoose.Schema(
   { timestamps: true }
 );
 
+UserSchema.index({ "username": 1 }); // username 索引
+
 export default mongoose.models.User || mongoose.model("User", UserSchema);

+ 4 - 8
src/app/ui/BasketballMatch.jsx

@@ -13,10 +13,6 @@ const BasketballMatch = ({ selectedDayMatches, currentUser }) => {
   const [alert, setAlert] = useState(null);
   const [predictions, setPredictions] = useState([]);
 
-  console.log("selectedDayMatches", selectedDayMatches);
-
-  console.log("predictions", predictions);
-
   // 获取用户预测
   useEffect(() => {
     const fetchPredictions = async () => {
@@ -298,8 +294,8 @@ const BasketballMatch = ({ selectedDayMatches, currentUser }) => {
                 >
                   {match.homeTeam.name}{" "}
                   {match.basketball?.spread?.favorite === "home"
-                    ? `+${Math.abs(match.basketball?.spread?.points || 0)}`
-                    : `-${Math.abs(match.basketball?.spread?.points || 0)}`}
+                    ? `-${Math.abs(match.basketball?.spread?.points || 0)}`
+                    : `+${Math.abs(match.basketball?.spread?.points || 0)}`}
                 </button>
                 {/* 客队 */}
                 <button
@@ -315,8 +311,8 @@ const BasketballMatch = ({ selectedDayMatches, currentUser }) => {
                 >
                   {match.awayTeam.name}{" "}
                   {match.basketball?.spread?.favorite === "away"
-                    ? `+${Math.abs(match.basketball?.spread?.points || 0)}`
-                    : `-${Math.abs(match.basketball?.spread?.points || 0)}`}
+                    ? `-${Math.abs(match.basketball?.spread?.points || 0)}`
+                    : `+${Math.abs(match.basketball?.spread?.points || 0)}`}
                 </button>
               </div>
             </div>

+ 0 - 20
src/app/ui/FootballMatch.jsx

@@ -32,33 +32,14 @@ const FootballMatch = ({ selectedDayMatches, currentUser }) => {
 
   const [selectedFirstTeamToScore, setSelectedFirstTeamToScore] = useState(""); // ["home", "away", "no_goal"]
 
-  // console.log("selectedDayMatches", selectedDayMatches);
-  // console.log("selectedFirstTeamToScore", selectedFirstTeamToScore);
-
-  // console.log(
-  //   "selectedFirstTeamToScoreOfMatch",
-  //   selectedFirstTeamToScoreOfMatch
-  // );
-  // console.log("selectedMatchId", selectedMatchId);
-  // console.log("selectedMatch", selectedMatch);
-
-  // console.log("selectedWinTeams", selectedWinTeams);
-  // console.log("totalGoalCountOfMatch", totalGoalCountOfMatch);
-
   const selectedWinTeam = selectedWinTeams[selectedMatchId] || "";
 
-  // console.log("selectedWinTeam", selectedWinTeam);
-
-  // console.log("predictions", predictions);
-
   const predictionMap = predictions.reduce((map, prediction) => {
     map[prediction.matchId] = prediction;
     return map;
   }, {});
-  // console.log("predictionMap", predictionMap);
 
   useEffect(() => {
-    // console.log("currentUser", currentUser);
     const fetchPredictions = async () => {
       try {
         const res = await fetchApi(
@@ -79,7 +60,6 @@ const FootballMatch = ({ selectedDayMatches, currentUser }) => {
   }, [currentUser]);
 
   useEffect(() => {
-    console.log("selectedMatchId", selectedMatchId);
     if (selectedMatchId !== null) {
       handleSubmitPredictions();
     }

+ 0 - 1
src/app/ui/MatchPrediction.jsx

@@ -42,7 +42,6 @@ const MatchPrediction = ({ currentUser }) => {
   const [footballMatches, setFootballMatches] = useState([]);
   const [basketballMatches, setBasketballMatches] = useState([]);
 
-  console.log("activeTab", activeTab);
   const handleMatchSelect = (matches) => {
     if (activeTab === "football") {
       setFootballMatches(matches);