Skip to content

Commit

Permalink
add space to zod schema, 3 seconds toast
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanjam committed Sep 23, 2024
1 parent a8a3421 commit 27d65ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/registration-form/registration-flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import StepProfile from '@/components/registration-form/step-profile';
import StepVehicle from '@/components/registration-form/step-vehicle';
import { REGISTRATION_STEPS } from '@/constants/registration';

/** testing data */
const __defaultValues: UserRegisterSchemaValues = {
name: 'John Doe',
zip: '12345',
Expand Down
2 changes: 1 addition & 1 deletion config/env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** in milliseconds */
export const SERVER_ACTION_DELAY = 2000;

export const TOAST_DURATION = 5000;
export const TOAST_DURATION = 3000;

export const FORM_RESET_DELAY = 2000;
3 changes: 2 additions & 1 deletion lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { z } from 'zod';
export const userRegisterSchema = z.object({
name: z
.string()
.trim()
.min(1, 'Name is required')
.regex(/^[A-Za-z]+$/, 'Name must contain only letters'),
.regex(/^[A-Za-z\s]+$/, 'Name must contain only letters and spaces'),
zip: z.string().regex(/^\d{5}$/, 'ZIP code must be exactly 5 digits'),
email: z.string().email('Invalid email address'),
phone: z
Expand Down

0 comments on commit 27d65ef

Please sign in to comment.