diff --git a/back/routes/activity.js b/back/routes/activity.js index d920b2b..f2c7714 100644 --- a/back/routes/activity.js +++ b/back/routes/activity.js @@ -642,6 +642,7 @@ router.get("/activity_list", async (req, res) => { "activity_type_id", "start_date", "end_date", + "recent_edit", "feedback_type", ], order: [["recent_edit", "DESC"]], @@ -664,6 +665,7 @@ router.get("/activity_list", async (req, res) => { activityType: activity.activity_type.type, startDate: formatDateString(activity.start_date), endDate: formatDateString(activity.end_date), + recentEdit: formatDateString(activity.recent_edit), feedbackType: activity.feedback_type, })), }); diff --git a/back/routes/funding.js b/back/routes/funding.js index 447738a..62651a5 100644 --- a/back/routes/funding.js +++ b/back/routes/funding.js @@ -63,6 +63,7 @@ router.get("/funding_list", async (req, res) => { "approved_amount", "purpose", "funding_feedback_type", + "recent_edit", // Add other required fields ], order: [ @@ -100,6 +101,7 @@ router.get("/funding_list", async (req, res) => { approvedAmount: funding.approved_amount, feedbackType: funding.funding_feedback_type, activityName: activityName, + recentEdit: funding.recent_edit, // Map other required fields }; }) diff --git a/front/src/pages/club/ClubManage/ClubManage.tsx b/front/src/pages/club/ClubManage/ClubManage.tsx index e82a82e..c1181e8 100644 --- a/front/src/pages/club/ClubManage/ClubManage.tsx +++ b/front/src/pages/club/ClubManage/ClubManage.tsx @@ -34,6 +34,7 @@ type ActivityInfo = { startDate: string; endDate: string; feedbackType: number; + recentEdit: string; }; type FundingInfo = { @@ -44,6 +45,7 @@ type FundingInfo = { expenditureDate: string; approvedAmount: number; feedbackType: number; + recentEdit: string; }; type ApplyInfo = { @@ -141,13 +143,9 @@ export const ClubManage = (): JSX.Element => { setSpringApprovedMoney( data.funding ?.filter((funding: FundingInfo) => { - const expenditureDate = new Date(funding.expenditureDate); - const targetStartDate = new Date("2023-12-16"); - const targetEndDate = new Date("2024-06-14"); - return ( - expenditureDate >= targetStartDate && - expenditureDate <= targetEndDate - ); + const recentDate = new Date(funding.recentEdit); + const targetDate = new Date("2024-06-01"); + return recentDate > targetDate; }) .reduce( (total: number, funding: FundingInfo) => @@ -158,13 +156,9 @@ export const ClubManage = (): JSX.Element => { setSpringExpenditureMoney( data.funding ?.filter((funding: FundingInfo) => { - const expenditureDate = new Date(funding.expenditureDate); - const targetStartDate = new Date("2023-12-16"); - const targetEndDate = new Date("2024-06-14"); - return ( - expenditureDate >= targetStartDate && - expenditureDate <= targetEndDate - ); + const recentDate = new Date(funding.recentEdit); + const targetDate = new Date("2024-06-01"); + return recentDate > targetDate; }) .reduce( (total: number, funding: FundingInfo) => @@ -485,14 +479,9 @@ export const ClubManage = (): JSX.Element => { /> {activitiesLists[status.clubId] ?.filter((activity) => { - const startDate = new Date(activity.startDate); - const endDate = new Date(activity.endDate); - const targetStartDate = new Date("2023-12-16"); - const targetEndDate = new Date("2024-06-14"); - return ( - startDate >= targetStartDate && - endDate <= targetEndDate - ); + const recentDate = new Date(activity.recentEdit); + const targetDate = new Date("2024-06-01"); + return recentDate > targetDate; }) .map((activity, index) => ( {
{activitiesLists[status.clubId]?.filter((activity) => { - const startDate = new Date(activity.startDate); - const endDate = new Date(activity.endDate); - const targetStartDate = new Date("2023-12-16"); - const targetEndDate = new Date("2024-06-14"); - return ( - startDate >= targetStartDate && - endDate <= targetEndDate - ); + const recentDate = new Date(activity.recentEdit); + const targetDate = new Date("2024-06-01"); + return recentDate > targetDate; }).length < 20 && status.typeId < 4 && durationStatus === 1 && ( @@ -561,14 +545,9 @@ export const ClubManage = (): JSX.Element => { /> {activitiesLists[status.clubId] ?.filter((activity) => { - const startDate = new Date(activity.startDate); - const endDate = new Date(activity.endDate); - const targetStartDate = new Date("2023-06-17"); - const targetEndDate = new Date("2023-12-15"); - return ( - startDate >= targetStartDate && - endDate <= targetEndDate - ); + const recentDate = new Date(activity.recentEdit); + const targetDate = new Date("2024-06-01"); + return recentDate <= targetDate; }) .map((activity, index) => ( { /> {fundingLists[status.clubId] ?.filter((funding) => { - const expenditureDate = new Date( - funding.expenditureDate - ); - const targetStartDate = new Date("2023-12-16"); - const targetEndDate = new Date("2024-06-14"); - return ( - expenditureDate >= targetStartDate && - expenditureDate <= targetEndDate - ); + const recentDate = new Date(funding.recentEdit); + const targetDate = new Date("2024-06-01"); + return recentDate > targetDate; }) .map((funding, index) => ( { id={0} /> {fundingLists[status.clubId] - ?.filter((funding) => { - const expenditureDate = new Date( - funding.expenditureDate - ); - const targetStartDate = new Date("2023-06-17"); - const targetEndDate = new Date("2023-12-15"); - return ( - expenditureDate >= targetStartDate && - expenditureDate <= targetEndDate - ); + ?.filter((activity) => { + const recentDate = new Date(activity.recentEdit); + const targetDate = new Date("2024-06-01"); + return recentDate <= targetDate; }) .map((funding, index) => (