Skip to content

Commit ee857cb

Browse files
fix: use .catch() instead of .default() for period validation in checkout (#3972)
.default() only applies when value is undefined, but .catch() handles any invalid value (e.g. 'monthly/' with trailing slash from Safari URL handling) by falling back to 'monthly'. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: yujonglee <yujonglee.dev@gmail.com>
1 parent 2138dbd commit ee857cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/web/src/routes/_view/app/checkout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const VALID_SCHEMES = [
1111
] as const;
1212

1313
const validateSearch = z.object({
14-
period: z.enum(["monthly", "yearly"]).default("monthly"),
14+
period: z.enum(["monthly", "yearly"]).catch("monthly"),
1515
scheme: z.enum(VALID_SCHEMES).optional(),
1616
});
1717

0 commit comments

Comments
 (0)