Skip to content

Commit e57edda

Browse files
authored
Merge pull request #57 from InserToken/feat/17-pracMain/minseon
[modify] 로고 , url
2 parents 7d7b1f0 + 3c427d9 commit e57edda

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

routes/practiceProblem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ router.get("/", async (req, res) => {
3434
query.problemtype = { $in: categoryArr };
3535
}
3636

37-
const pageSize = 20;
37+
const pageSize = 15;
3838
const totalCount = await PracticeProblem.countDocuments(query);
3939
console.log("totalCount", totalCount);
4040
const problems = await PracticeProblem.find(query)

routes/ranking.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ router.get("/practice", authenticate, async (req, res) => {
1313
const userId = req.user._id;
1414

1515
const scores = await PracticeScore.find({ user_id: userId })
16-
.populate({
17-
path: "problem_id",
18-
select: "stock_code title date problemtype", // 필요한 필드만 선택
19-
strictPopulate: false,
20-
})
16+
.populate([
17+
{
18+
path: "problem_id",
19+
select: "stock_code title date problemtype",
20+
populate: {
21+
path: "stock_code",
22+
select: "name logo",
23+
strictPopulate: false,
24+
},
25+
strictPopulate: false,
26+
},
27+
])
2128
.sort({ date: -1 }); // 최신순 정렬
2229

2330
res.json({

tasks/scoreUpdater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const cron = require("node-cron");
22
// 실제 서버 주소로 변경!
3-
const BASE_URL = `${process.env.NEXT_PUBLIC_API_URL}/api/rank`;
3+
const BASE_URL = `http://localhost:3001/api/rank`;
44

55
cron.schedule("10 8 * * *", async () => {
66
try {

0 commit comments

Comments
 (0)