Skip to content
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

Chip 파트 한 개 이슈 대응 #932

Merged
merged 16 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pages/edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const EditPage = () => {
parts.length - 2 === formData?.joinableParts.length
? parts
: // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
[parts[0], ...formData!.joinableParts.map(partString => parts.find(part => part.value === partString))];
[...formData!.joinableParts.map(partString => parts.find(part => part.value === partString))];

formMethods.reset({
...formData,
Expand All @@ -94,7 +94,6 @@ const EditPage = () => {
isMentorNeeded: formData?.isMentorNeeded,
joinableParts,
canJoinOnlyActiveGeneration: formData?.canJoinOnlyActiveGeneration,
//targetDesc: formData?.targetDesc,
note: formData?.note ?? '',
},
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/TableOfContents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ function TableOfContents({ label }: TableOfContentsProps) {
const isTargetValid =
form.detail &&
form.detail.joinableParts &&
form.detail.joinableParts.length > 1 &&
form.detail.joinableParts.length > 0 &&
form.capacity &&
!errors.capacity &&
!errors.detail; // default 옵션이 선택되어 있기 때문 최소 2개 이상 선택되어야 통과
!errors.detail;
const isActivationDateValid = form.detail && form.detail.mStartDate && form.detail.mEndDate;
const isProcessDesc = form.detail?.processDesc;
return (
Expand Down
2 changes: 1 addition & 1 deletion src/types/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const schema = z.object({
value: z.string().nullable(),
})
)
.min(2, { message: '대상 파트를 선택해주세요.' }), // NOTE: default 옵션에 더해 최소 1개는 선택해야 한다(총 2개)
.min(1, { message: '대상 파트를 선택해주세요.' }),
note: z.string().max(1000, { message: '1000자 까지 입력 가능합니다.' }).optional().nullable(),
}),
});
Expand Down
Loading