-
Notifications
You must be signed in to change notification settings - Fork 1
fix/140 3차 QA수정사항수정 #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/140 3차 QA수정사항수정 #142
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -141,10 +141,29 @@ export const useEditActivityForm = () => { | |||||||||
| } | ||||||||||
|
|
||||||||||
| const newSchedules = dates.filter((d) => !d.id); | ||||||||||
|
|
||||||||||
| const scheduleIdsToRemove = originalSchedules | ||||||||||
| .filter((orig) => !dates.some((d) => d.id === orig.id)) | ||||||||||
| .map((d) => d.id) | ||||||||||
| .filter((id): id is number => id !== undefined); | ||||||||||
| .map((d) => d.id!) | ||||||||||
| .filter(Boolean); | ||||||||||
|
Comment on lines
+147
to
+148
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 타입 안전성 개선 제안
다음과 같이 수정하세요: - .map((d) => d.id!)
- .filter(Boolean);
+ .map((d) => d.id)
+ .filter((id): id is number => id !== undefined);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| originalSchedules.forEach((orig) => { | ||||||||||
| const matched = dates.find((d) => d.id === orig.id); | ||||||||||
| if ( | ||||||||||
| matched && | ||||||||||
| (matched.date !== orig.date || | ||||||||||
| matched.startTime !== orig.startTime || | ||||||||||
| matched.endTime !== orig.endTime) | ||||||||||
| ) { | ||||||||||
| newSchedules.push({ | ||||||||||
| date: matched.date, | ||||||||||
| startTime: matched.startTime, | ||||||||||
| endTime: matched.endTime, | ||||||||||
| }); | ||||||||||
|
|
||||||||||
| scheduleIdsToRemove.push(orig.id!); | ||||||||||
| } | ||||||||||
| }); | ||||||||||
|
|
||||||||||
| const parsedPrice = parseInt(price, 10); | ||||||||||
| if (isNaN(parsedPrice) || parsedPrice <= 0) { | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
날짜 포맷팅 방식 견고성 부족
slice(0, 10).replace(/-/g, '.')는 ISO-8601 형식이 아닐 경우 깨질 수 있습니다.dayjs,date-fns등의 라이브러리 사용을 권장합니다.🤖 Prompt for AI Agents