Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
uxiun committed Jan 17, 2025
2 parents 8fdab99 + 98463eb commit 4e9857b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/app/adjust/WeekView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export function WeekView({
const handlePreviousWeek = () => {
setCurrentWeekIndex(prevIndex => Math.max(prevIndex - 1, 0))
}
console.log("coursePeriods:", coursePeriods)

/** @todo Reduce this TOO DEEP nest */
return (
Expand Down
16 changes: 5 additions & 11 deletions src/app/adjust/candidate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,21 @@ export default function Candidate(props: Props) {
}, [props.title])

// 自分の授業とその時間の配列
const coursePeriods: CoursePeriod[] = props.courses.map(course => ({
course,
periods: courseToPeriods(new Date(), course),
}))
const coursePeriods: CoursePeriod[] = coursePeriodsThroughWeeks(props.courses, new Date())

async function handleSchedule() {
setIsButtonActive(false)
try {
// 招待相手ごとの授業とその時間の配列
const coursePeriodsOfGuests: CoursePeriod[][] = (
const coursesOfGuests: Course[][] = (
await Promise.all(props.selectedUserIds.map(getUserCourseCodes))
).map(codes =>
props.allCourses
.filter(({ code }) => codes.includes(code))
.map(course => ({
course,
periods: courseToPeriods(new Date(), course),
})),
)

const coursePeriodsOfGuests = coursesOfGuests.map(courses => coursePeriodsThroughWeeks(courses, new Date()))

console.debug("自分の授業とその時間の配列", coursePeriods)
console.debug("招待相手ごとの授業とその時間の配列", coursePeriodsOfGuests)

Expand Down Expand Up @@ -151,12 +146,11 @@ export default function Candidate(props: Props) {
handlePeriodClick={handlePeriodClick}
periods={freePeriods}
isButtonActive={isButtonActive}
courses={props.courses}
coursePeriods={coursePeriods}
/>
) : (
""
)}

</div>
)
}

0 comments on commit 4e9857b

Please sign in to comment.