first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:07:47 +03:00
commit 5285a0dd86
522 changed files with 41738 additions and 0 deletions

27
utils/validations.ts Normal file
View File

@@ -0,0 +1,27 @@
import { z } from 'zod';
export const loginSchema = z.object({
email: z
.string()
.min(1, { message: 'E-posta adresi zorunludur' })
.email({ message: 'Geçerli bir e-posta adresi giriniz' }),
password: z
.string()
.min(1, { message: 'Şifre zorunludur' })
});
export const registerSchema = z.object({
username: z.string().min(3, { message: 'Kullanıcı adı en az 3 karakter olmalıdır' }),
first_name: z.string().min(2, { message: 'Ad en az 2 karakter olmalıdır' }),
last_name: z.string().min(2, { message: 'Soyad en az 2 karakter olmalıdır' }),
email: z.string().email({ message: 'Geçerli bir e-posta adresi giriniz' }),
password: z.string().min(8, { message: 'Şifre en az 8 karakter olmalıdır' }),
passwordConfirm: z.string().min(1, { message: 'Şifre tekrarı zorunludur' })
}).refine((data) => data.password === data.passwordConfirm, {
message: "Şifreler eşleşmiyor",
path: ["passwordConfirm"],
});
export type LoginInput = z.infer<typeof loginSchema>;
export type RegisterInput = z.infer<typeof registerSchema>;