Skip to content

Commit

Permalink
Refactor: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kmc7468 committed Feb 14, 2024
1 parent a9e73ac commit e8c9a9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/lottery/routes/docs/questsSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ const questsSchema = {
properties: {
questId: {
type: "string",
enum: [
"roomSharing",
"eventSharingOnInstagram",
"purchaseSharingOnInstagram",
],
enum: ["roomSharing"],
},
},
},
Expand Down
7 changes: 6 additions & 1 deletion src/lottery/services/globalState.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { eventStatusModel } = require("../modules/stores/mongo");
const { userModel } = require("../../modules/stores/mongo");
const logger = require("../../modules/logger");
const { isLogin, getLoginInfo } = require("../../modules/auths/login");
const { nodeEnv } = require("../../../loadenv");

const contracts = require("../modules/contracts");
const quests = Object.values(contracts.quests);
Expand Down Expand Up @@ -81,8 +82,12 @@ const createUserGlobalStateHandler = async (req, res) => {
.json({ error: "GlobalState/Create : internal server error" });

// 24학번 학사 과정 학생이 아닌 경우 이벤트에 참여할 수 없습니다.
// 테스트를 위해, production 환경에서만 학번을 확인합니다.
const kaistId = parseInt(user.subinfo?.kaist || "0");
if (!(20240001 <= kaistId && kaistId <= 20241500)) {
if (
nodeEnv === "production" &&
!(20240001 <= kaistId && kaistId <= 20241500)
) {
return res.status(400).json({
error: "GlobalState/Create : not an undergraduate freshman",
});
Expand Down

0 comments on commit e8c9a9c

Please sign in to comment.