chopme-frontend-common 1.0.15 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,6 @@ export declare const createClientSchema: z.ZodObject<{
3
3
  fullName: z.ZodString;
4
4
  email: z.ZodEmail;
5
5
  password: z.ZodString;
6
+ confirmPassword: z.ZodString;
6
7
  }, z.core.$strip>;
7
8
  export type CreateClientDto = z.infer<typeof createClientSchema>;
@@ -2,57 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createClientSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.createClientSchema = zod_1.z.object({
5
+ exports.createClientSchema = zod_1.z
6
+ .object({
6
7
  fullName: zod_1.z.string().min(1, "Full name is required"),
7
8
  email: zod_1.z.email("Enter a valid email address"),
8
9
  password: zod_1.z
9
10
  .string()
10
11
  .min(8, "Password must be at least 8 characters long")
11
12
  .regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\w\s]).+$/, "Password must contain uppercase, lowercase, number and special character"),
13
+ confirmPassword: zod_1.z.string().min(1, "Please confirm your password"),
14
+ })
15
+ .refine((data) => data.password === data.confirmPassword, {
16
+ message: "Passwords do not match",
17
+ path: ["confirmPassword"],
12
18
  });
13
- // import { useForm } from 'react-hook-form';
14
- // import { zodResolver } from '@hookform/resolvers/zod';
15
- // import {
16
- // createClientSchema,
17
- // type CreateClientDto,
18
- // } from '@chopme/shared';
19
- // export function RegisterPage() {
20
- // const {
21
- // register,
22
- // handleSubmit,
23
- // formState: { errors },
24
- // } = useForm<CreateClientDto>({
25
- // resolver: zodResolver(createClientSchema),
26
- // defaultValues: {
27
- // fullName: '',
28
- // email: '',
29
- // password: '',
30
- // },
31
- // });
32
- // const onSubmit = (data: CreateClientDto) => {
33
- // console.log(data);
34
- // };
35
- // return (
36
- // <form onSubmit={handleSubmit(onSubmit)}>
37
- // <input
38
- // placeholder="Full name"
39
- // {...register('fullName')}
40
- // />
41
- // <p>{errors.fullName?.message}</p>
42
- // <input
43
- // placeholder="Email"
44
- // {...register('email')}
45
- // />
46
- // <p>{errors.email?.message}</p>
47
- // <input
48
- // type="password"
49
- // placeholder="Password"
50
- // {...register('password')}
51
- // />
52
- // <p>{errors.password?.message}</p>
53
- // <button type="submit">
54
- // Register
55
- // </button>
56
- // </form>
57
- // );
58
- // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chopme-frontend-common",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",