Skip to content

Commit 22e58e8

Browse files
authored
fix: 1, 3순위를 선택했으나 2순위를 선택하지 않았을 경우 Validation 을 막지 않았던 문제 수정 (#113)
1 parent 7ff3b32 commit 22e58e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/schemas/gathering/opinionForm.schema.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ export const preferredCategoriesSchema = z
4949
.refine((data) => !isUndefined(data.first), {
5050
message: "최소 1개의 음식을 선택해주세요",
5151
path: ["first"],
52+
})
53+
.refine((data) => !data.second || data.first, {
54+
message: "1순위를 먼저 선택해주세요",
55+
path: ["second"],
56+
})
57+
.refine((data) => !data.third || data.second, {
58+
message: "2순위를 먼저 선택해주세요",
59+
path: ["third"],
5260
});
5361

5462
export const opinionFormSchema = z.object({

0 commit comments

Comments
 (0)