Skip to content

Commit c7158f4

Browse files
committed
fix: memo optional 로 변경
- memo 필드가 폼 데이터에 포함되지 않아도 유효성 검사를 통과할 수 있도록 함
1 parent 0595547 commit c7158f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/service/post/constraints.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ export const postSchema = z.object({
2121
.string()
2222
.min(POST_CONTENT_MIN_LENGTH, POST_CONTENT_MIN_LENGTH_ERROR)
2323
.max(POST_CONTENT_MAX_LENGTH, POST_CONTENT_MAX_LENGTH_ERROR),
24-
memo: z.string().min(POST_MEMO_MIN_LENGTH).max(POST_MEMO_MAX_LENGTH),
24+
memo: z
25+
.string()
26+
.min(POST_MEMO_MIN_LENGTH)
27+
.max(POST_MEMO_MAX_LENGTH)
28+
.optional(),
2529
});
2630

2731
export type PostSchema = z.infer<typeof postSchema>;

0 commit comments

Comments
 (0)