Skip to content

Commit

Permalink
refactor: club detail api
Browse files Browse the repository at this point in the history
  • Loading branch information
pbc1017 committed Mar 17, 2024
1 parent c3ecdde commit f4aa0b5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions back/routes/club.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ router.get("/club_detail", async (req, res) => {
attributes: ["type_id", "characteristic_kr", "advisor"],
});

if (!semesterClubInfo) {
return res.status(404).json({
success: false,
message: "Semester club information not found",
});
}
// if (!semesterClubInfo) {
// return res.status(404).json({
// success: false,
// message: "Semester club information not found",
// });
// }

// Find the type from the SemesterClubType model
const semesterClubType = await SemesterClubType.findByPk(
semesterClubInfo.type_id
semesterClubInfo ? semesterClubInfo.type_id : 3
);

// Determine clubType based on PermanentClub existence
Expand Down Expand Up @@ -134,8 +134,10 @@ router.get("/club_detail", async (req, res) => {
clubName: club.name,
divisionName: club.division.name ? club.division.name : "",
clubType: clubType,
characteristicKr: semesterClubInfo.characteristic_kr,
advisor: semesterClubInfo.advisor,
characteristicKr: semesterClubInfo
? semesterClubInfo.characteristic_kr
: "",
advisor: semesterClubInfo ? semesterClubInfo.advisor : null,
totalMembers: totalMembersCount,
clubPresident: clubPresident,
description: club.description,
Expand Down

0 comments on commit f4aa0b5

Please sign in to comment.