feat(student): added parents field in signup
This commit is contained in:
@@ -529,6 +529,74 @@ export default function ProfilePage() {
|
|||||||
<Input id="mothersName" value={student.mothersName || ''} readOnly />
|
<Input id="mothersName" value={student.mothersName || ''} readOnly />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="mothersEmail">Mother's Email</Label>
|
||||||
|
{editingSection === 'personal' ? (
|
||||||
|
<Input
|
||||||
|
id="mothersEmail"
|
||||||
|
type="email"
|
||||||
|
value={editData.mothersEmail || student.mothersEmail || ''}
|
||||||
|
onChange={(e) => handleInputChange('mothersEmail', e.target.value)}
|
||||||
|
placeholder="mother@example.com"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Input id="mothersEmail" value={student.mothersEmail || ''} readOnly />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="mothersPhone">Mother's Phone</Label>
|
||||||
|
{editingSection === 'personal' ? (
|
||||||
|
<Input
|
||||||
|
id="mothersPhone"
|
||||||
|
type="tel"
|
||||||
|
value={editData.mothersPhone || student.mothersPhone || ''}
|
||||||
|
onChange={(e) => handleInputChange('mothersPhone', e.target.value)}
|
||||||
|
placeholder="10-digit number"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Input id="mothersPhone" value={student.mothersPhone || ''} readOnly />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="fathersName">Father's Name</Label>
|
||||||
|
{editingSection === 'personal' ? (
|
||||||
|
<Input
|
||||||
|
id="fathersName"
|
||||||
|
value={editData.fathersName || student.fathersName || ''}
|
||||||
|
onChange={(e) => handleInputChange('fathersName', e.target.value)}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Input id="fathersName" value={student.fathersName || ''} readOnly />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="fathersEmail">Father's Email</Label>
|
||||||
|
{editingSection === 'personal' ? (
|
||||||
|
<Input
|
||||||
|
id="fathersEmail"
|
||||||
|
type="email"
|
||||||
|
value={editData.fathersEmail || student.fathersEmail || ''}
|
||||||
|
onChange={(e) => handleInputChange('fathersEmail', e.target.value)}
|
||||||
|
placeholder="father@example.com"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Input id="fathersEmail" value={student.fathersEmail || ''} readOnly />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="fathersPhone">Father's Phone</Label>
|
||||||
|
{editingSection === 'personal' ? (
|
||||||
|
<Input
|
||||||
|
id="fathersPhone"
|
||||||
|
type="tel"
|
||||||
|
value={editData.fathersPhone || student.fathersPhone || ''}
|
||||||
|
onChange={(e) => handleInputChange('fathersPhone', e.target.value)}
|
||||||
|
placeholder="10-digit number"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Input id="fathersPhone" value={student.fathersPhone || ''} readOnly />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Label htmlFor="personalGmail">Personal Email</Label>
|
<Label htmlFor="personalGmail">Personal Email</Label>
|
||||||
{editingSection === 'personal' ? (
|
{editingSection === 'personal' ? (
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ export async function signupAction(data: StudentSignup) {
|
|||||||
middleName: student.middleName,
|
middleName: student.middleName,
|
||||||
lastName: student.lastName,
|
lastName: student.lastName,
|
||||||
mothersName: student.mothersName,
|
mothersName: student.mothersName,
|
||||||
|
mothersEmail: student.mothersEmail && student.mothersEmail.length ? student.mothersEmail : null,
|
||||||
|
mothersPhone: student.mothersPhone && student.mothersPhone.length ? student.mothersPhone : null,
|
||||||
|
fathersName: student.fathersName,
|
||||||
|
fathersEmail: student.fathersEmail && student.fathersEmail.length ? student.fathersEmail : null,
|
||||||
|
fathersPhone: student.fathersPhone && student.fathersPhone.length ? student.fathersPhone : null,
|
||||||
gender: student.gender,
|
gender: student.gender,
|
||||||
dob: student.dob,
|
dob: student.dob,
|
||||||
personalGmail: student.personalGmail,
|
personalGmail: student.personalGmail,
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ const steps = [
|
|||||||
'firstName',
|
'firstName',
|
||||||
'lastName',
|
'lastName',
|
||||||
'mothersName',
|
'mothersName',
|
||||||
|
'mothersEmail',
|
||||||
|
'mothersPhone',
|
||||||
|
'fathersName',
|
||||||
|
'fathersEmail',
|
||||||
|
'fathersPhone',
|
||||||
'rollNumber',
|
'rollNumber',
|
||||||
'phoneNumber',
|
'phoneNumber',
|
||||||
'address',
|
'address',
|
||||||
@@ -67,6 +72,11 @@ export default function StudentRegistrationForm() {
|
|||||||
middleName: '',
|
middleName: '',
|
||||||
lastName: '',
|
lastName: '',
|
||||||
mothersName: '',
|
mothersName: '',
|
||||||
|
mothersEmail: '',
|
||||||
|
mothersPhone: '',
|
||||||
|
fathersName: '',
|
||||||
|
fathersEmail: '',
|
||||||
|
fathersPhone: '',
|
||||||
rollNumber: '',
|
rollNumber: '',
|
||||||
phoneNumber: '',
|
phoneNumber: '',
|
||||||
address: '',
|
address: '',
|
||||||
@@ -175,6 +185,11 @@ export default function StudentRegistrationForm() {
|
|||||||
middleName: 'Middle Name',
|
middleName: 'Middle Name',
|
||||||
lastName: 'Last Name',
|
lastName: 'Last Name',
|
||||||
mothersName: "Mother's Name",
|
mothersName: "Mother's Name",
|
||||||
|
mothersEmail: "Mother's Email",
|
||||||
|
mothersPhone: "Mother's Phone Number",
|
||||||
|
fathersName: "Father's Name",
|
||||||
|
fathersEmail: "Father's Email",
|
||||||
|
fathersPhone: "Father's Phone Number",
|
||||||
rollNumber: 'Roll Number',
|
rollNumber: 'Roll Number',
|
||||||
phoneNumber: 'Phone Number',
|
phoneNumber: 'Phone Number',
|
||||||
address: 'Address',
|
address: 'Address',
|
||||||
@@ -219,8 +234,13 @@ export default function StudentRegistrationForm() {
|
|||||||
|
|
||||||
{/* Welcoming heading - now always at the top */}
|
{/* Welcoming heading - now always at the top */}
|
||||||
<div className="w-full text-center mb-8 z-10">
|
<div className="w-full text-center mb-8 z-10">
|
||||||
<h1 className="text-4xl font-extrabold text-primary drop-shadow-sm tracking-tight mb-2">Welcome to Placement Portal</h1>
|
<h1 className="text-4xl font-extrabold text-primary drop-shadow-sm tracking-tight mb-2">
|
||||||
<p className="text-lg text-gray-500 max-w-xl mx-auto">Register below to get started with your placement journey. Fill in your details step by step and let your career take off!</p>
|
Welcome to Placement Portal
|
||||||
|
</h1>
|
||||||
|
<p className="text-lg text-gray-500 max-w-xl mx-auto">
|
||||||
|
Register below to get started with your placement journey. Fill in your details step by
|
||||||
|
step and let your career take off!
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="max-w-4xl w-full mx-auto px-4 z-10">
|
<div className="max-w-4xl w-full mx-auto px-4 z-10">
|
||||||
<Card className="shadow-2xl rounded-3xl border border-gray-200 bg-white/90 backdrop-blur-md">
|
<Card className="shadow-2xl rounded-3xl border border-gray-200 bg-white/90 backdrop-blur-md">
|
||||||
@@ -233,7 +253,9 @@ export default function StudentRegistrationForm() {
|
|||||||
<span>
|
<span>
|
||||||
Step {currentStep} of {steps.length}
|
Step {currentStep} of {steps.length}
|
||||||
</span>
|
</span>
|
||||||
<span className="font-semibold text-primary/80">{steps[currentStep - 1]?.title}</span>
|
<span className="font-semibold text-primary/80">
|
||||||
|
{steps[currentStep - 1]?.title}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Progress value={progress} className="w-full h-2 rounded-full bg-muted" />
|
<Progress value={progress} className="w-full h-2 rounded-full bg-muted" />
|
||||||
</div>
|
</div>
|
||||||
@@ -242,7 +264,8 @@ export default function StudentRegistrationForm() {
|
|||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form
|
<form
|
||||||
ref={formRef}
|
ref={formRef}
|
||||||
onSubmit={currentStep === steps.length
|
onSubmit={
|
||||||
|
currentStep === steps.length
|
||||||
? form.handleSubmit(onSubmit, () => {
|
? form.handleSubmit(onSubmit, () => {
|
||||||
// Get all error fields
|
// Get all error fields
|
||||||
const errorFields = extractErrorFields(form.formState.errors);
|
const errorFields = extractErrorFields(form.formState.errors);
|
||||||
@@ -256,7 +279,7 @@ export default function StudentRegistrationForm() {
|
|||||||
'Please fill all required fields before submitting.\n' +
|
'Please fill all required fields before submitting.\n' +
|
||||||
(prettyFields.length > 0
|
(prettyFields.length > 0
|
||||||
? 'Missing/invalid: ' + prettyFields.join(', ')
|
? 'Missing/invalid: ' + prettyFields.join(', ')
|
||||||
: '')
|
: ''),
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
: (e) => e.preventDefault()
|
: (e) => e.preventDefault()
|
||||||
@@ -284,11 +307,19 @@ export default function StudentRegistrationForm() {
|
|||||||
Previous
|
Previous
|
||||||
</Button>
|
</Button>
|
||||||
{currentStep === steps.length ? (
|
{currentStep === steps.length ? (
|
||||||
<Button type="submit" disabled={isSubmitting || isPending} className="rounded-full px-8 py-2 shadow-md bg-gradient-to-r from-primary to-accent text-white">
|
<Button
|
||||||
|
type="submit"
|
||||||
|
disabled={isSubmitting || isPending}
|
||||||
|
className="rounded-full px-8 py-2 shadow-md bg-gradient-to-r from-primary to-accent text-white"
|
||||||
|
>
|
||||||
{isSubmitting || isPending ? 'Submitting...' : 'Submit'}
|
{isSubmitting || isPending ? 'Submitting...' : 'Submit'}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button type="button" onClick={nextStep} className="rounded-full px-8 py-2 shadow-md bg-gradient-to-r from-primary to-accent text-white">
|
<Button
|
||||||
|
type="button"
|
||||||
|
onClick={nextStep}
|
||||||
|
className="rounded-full px-8 py-2 shadow-md bg-gradient-to-r from-primary to-accent text-white"
|
||||||
|
>
|
||||||
Next
|
Next
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
@@ -305,41 +336,70 @@ export default function StudentRegistrationForm() {
|
|||||||
/* lightest → darkest slate-blue progression */
|
/* lightest → darkest slate-blue progression */
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
120deg,
|
120deg,
|
||||||
#f1f5f9, /* slate-50 */
|
#f1f5f9,
|
||||||
#cbd5e1 30%, /* slate-200 */
|
/* slate-50 */ #cbd5e1 30%,
|
||||||
#94a3b8 60%, /* slate-400 */
|
/* slate-200 */ #94a3b8 60%,
|
||||||
#64748b 80%, /* slate-500 */
|
/* slate-400 */ #64748b 80%,
|
||||||
#334155 /* slate-700 */
|
/* slate-500 */ #334155 /* slate-700 */
|
||||||
);
|
);
|
||||||
background-size: 300% 300%;
|
background-size: 300% 300%;
|
||||||
animation: gradientMove 16s ease-in-out infinite;
|
animation: gradientMove 16s ease-in-out infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes gradientMove {
|
@keyframes gradientMove {
|
||||||
0% { background-position: 0% 50%; }
|
0% {
|
||||||
25% { background-position: 100% 50%; }
|
background-position: 0% 50%;
|
||||||
50% { background-position: 100% 100%; }
|
}
|
||||||
75% { background-position: 0% 100%; }
|
25% {
|
||||||
100% { background-position: 0% 50%; }
|
background-position: 100% 50%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position: 100% 100%;
|
||||||
|
}
|
||||||
|
75% {
|
||||||
|
background-position: 0% 100%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-position: 0% 50%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ====== BLOB COLORS ============================================ */
|
/* ====== BLOB COLORS ============================================ */
|
||||||
.animate-blob1 { background: #e2e8f0; } /* slate-100 */
|
.animate-blob1 {
|
||||||
.animate-blob2 { background: #cbd5e1; } /* slate-200 */
|
background: #e2e8f0;
|
||||||
.animate-blob3 { background: #94a3b8; } /* slate-400 */
|
} /* slate-100 */
|
||||||
.animate-blob4 { background: #64748b; } /* slate-500 */
|
.animate-blob2 {
|
||||||
.animate-blob5 { background: #475569; } /* slate-600 */
|
background: #cbd5e1;
|
||||||
|
} /* slate-200 */
|
||||||
|
.animate-blob3 {
|
||||||
|
background: #94a3b8;
|
||||||
|
} /* slate-400 */
|
||||||
|
.animate-blob4 {
|
||||||
|
background: #64748b;
|
||||||
|
} /* slate-500 */
|
||||||
|
.animate-blob5 {
|
||||||
|
background: #475569;
|
||||||
|
} /* slate-600 */
|
||||||
|
|
||||||
/* ====== BLOB MOTION (unchanged) ================================ */
|
/* ====== BLOB MOTION (unchanged) ================================ */
|
||||||
.animate-blob1 { animation: blobMove1 18s ease-in-out infinite; }
|
.animate-blob1 {
|
||||||
.animate-blob2 { animation: blobMove2 22s ease-in-out infinite; }
|
animation: blobMove1 18s ease-in-out infinite;
|
||||||
.animate-blob3 { animation: blobMove3 20s ease-in-out infinite; }
|
}
|
||||||
.animate-blob4 { animation: blobMove4 26s ease-in-out infinite; }
|
.animate-blob2 {
|
||||||
.animate-blob5 { animation: blobMove5 24s ease-in-out infinite; }
|
animation: blobMove2 22s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.animate-blob3 {
|
||||||
|
animation: blobMove3 20s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.animate-blob4 {
|
||||||
|
animation: blobMove4 26s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.animate-blob5 {
|
||||||
|
animation: blobMove5 24s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
/* existing keyframes … */
|
/* existing keyframes … */
|
||||||
`}</style>
|
`}</style>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,12 +26,29 @@ export const resumeSchema = z.object({
|
|||||||
link: z.string().url('Must be a valid URL'),
|
link: z.string().url('Must be a valid URL'),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const studentSignupSchema = z.object({
|
export const studentSignupSchema = z
|
||||||
|
.object({
|
||||||
rollNumber: z.string().min(1, 'Roll number is required').max(12),
|
rollNumber: z.string().min(1, 'Roll number is required').max(12),
|
||||||
firstName: z.string().min(1, 'First name is required').max(255),
|
firstName: z.string().min(1, 'First name is required').max(255),
|
||||||
middleName: z.string().max(255).optional(),
|
middleName: z.string().max(255).optional(),
|
||||||
lastName: z.string().min(1, 'Last name is required').max(255),
|
lastName: z.string().min(1, 'Last name is required').max(255),
|
||||||
mothersName: z.string().min(1, "Mother's name is required").max(255),
|
// Parent details (all optional individually; validated via refinements below)
|
||||||
|
mothersName: z.string().max(255).optional(),
|
||||||
|
mothersEmail: z.string().email('Must be a valid email').optional().or(z.literal('')),
|
||||||
|
mothersPhone: z
|
||||||
|
.string()
|
||||||
|
.min(10, 'Phone must be 10 digits')
|
||||||
|
.max(10)
|
||||||
|
.optional()
|
||||||
|
.or(z.literal('')),
|
||||||
|
fathersName: z.string().max(255).optional(),
|
||||||
|
fathersEmail: z.string().email('Must be a valid email').optional().or(z.literal('')),
|
||||||
|
fathersPhone: z
|
||||||
|
.string()
|
||||||
|
.min(10, 'Phone must be 10 digits')
|
||||||
|
.max(10)
|
||||||
|
.optional()
|
||||||
|
.or(z.literal('')),
|
||||||
gender: z.string().min(1, 'Gender is required').max(10),
|
gender: z.string().min(1, 'Gender is required').max(10),
|
||||||
dob: z.coerce.date().refine((date) => date <= new Date(), {
|
dob: z.coerce.date().refine((date) => date <= new Date(), {
|
||||||
message: 'Date of birth cannot be in the future',
|
message: 'Date of birth cannot be in the future',
|
||||||
@@ -51,7 +68,37 @@ export const studentSignupSchema = z.object({
|
|||||||
sgpi: z.array(sgpiSchema).length(8, 'Must provide grades for all 8 semesters'),
|
sgpi: z.array(sgpiSchema).length(8, 'Must provide grades for all 8 semesters'),
|
||||||
internships: z.array(internshipSchema),
|
internships: z.array(internshipSchema),
|
||||||
resume: z.array(resumeSchema),
|
resume: z.array(resumeSchema),
|
||||||
});
|
})
|
||||||
|
// Require at least one parent provided
|
||||||
|
.refine(
|
||||||
|
(data) => {
|
||||||
|
const motherProvided = Boolean((data.mothersName && data.mothersName.trim()) || (data.mothersEmail && data.mothersEmail.trim()) || (data.mothersPhone && data.mothersPhone.trim()));
|
||||||
|
const fatherProvided = Boolean((data.fathersName && data.fathersName.trim()) || (data.fathersEmail && data.fathersEmail.trim()) || (data.fathersPhone && data.fathersPhone.trim()));
|
||||||
|
return motherProvided || fatherProvided;
|
||||||
|
},
|
||||||
|
{
|
||||||
|
message: 'Provide details for at least one parent',
|
||||||
|
path: ['mothersName'],
|
||||||
|
},
|
||||||
|
)
|
||||||
|
// If mother's contact provided, require mother's name
|
||||||
|
.refine(
|
||||||
|
(data) => {
|
||||||
|
const motherContact = Boolean((data.mothersEmail && data.mothersEmail.trim()) || (data.mothersPhone && data.mothersPhone.trim()));
|
||||||
|
if (!motherContact) return true;
|
||||||
|
return Boolean(data.mothersName && data.mothersName.trim());
|
||||||
|
},
|
||||||
|
{ message: "Mother's name is required when mother's contact is provided", path: ['mothersName'] },
|
||||||
|
)
|
||||||
|
// If father's contact provided, require father's name
|
||||||
|
.refine(
|
||||||
|
(data) => {
|
||||||
|
const fatherContact = Boolean((data.fathersEmail && data.fathersEmail.trim()) || (data.fathersPhone && data.fathersPhone.trim()));
|
||||||
|
if (!fatherContact) return true;
|
||||||
|
return Boolean(data.fathersName && data.fathersName.trim());
|
||||||
|
},
|
||||||
|
{ message: "Father's name is required when father's contact is provided", path: ['fathersName'] },
|
||||||
|
);
|
||||||
|
|
||||||
export type StudentSignup = z.infer<typeof studentSignupSchema>;
|
export type StudentSignup = z.infer<typeof studentSignupSchema>;
|
||||||
export type Internship = z.infer<typeof internshipSchema>;
|
export type Internship = z.infer<typeof internshipSchema>;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export default function PersonalDetailsStep({ form }: { form: any }) {
|
|||||||
name="mothersName"
|
name="mothersName"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Mother's Name *</FormLabel>
|
<FormLabel>Mother's Name</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="Enter your mother's name" {...field} />
|
<Input placeholder="Enter your mother's name" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -89,6 +89,79 @@ export default function PersonalDetailsStep({ form }: { form: any }) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Parent contacts */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="mothersEmail"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Mother's Email</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="email" placeholder="mother@example.com" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="mothersPhone"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Mother's Phone</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="tel" placeholder="10-digit number" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<div className="hidden md:block" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="fathersName"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Father's Name</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input placeholder="Enter your father's name" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="fathersEmail"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Father's Email</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="email" placeholder="father@example.com" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="fathersPhone"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Father's Phone</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="tel" placeholder="10-digit number" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ export const students = pgTable('students', {
|
|||||||
middleName: varchar({ length: 255 }),
|
middleName: varchar({ length: 255 }),
|
||||||
lastName: varchar({ length: 255 }),
|
lastName: varchar({ length: 255 }),
|
||||||
mothersName: varchar({ length: 255 }),
|
mothersName: varchar({ length: 255 }),
|
||||||
|
mothersEmail: text(),
|
||||||
|
mothersPhone: varchar({ length: 10 }),
|
||||||
|
fathersName: varchar({ length: 255 }),
|
||||||
|
fathersEmail: text(),
|
||||||
|
fathersPhone: varchar({ length: 10 }),
|
||||||
gender: varchar({ length: 10 }),
|
gender: varchar({ length: 10 }),
|
||||||
dob: timestamp(),
|
dob: timestamp(),
|
||||||
personalGmail: text(),
|
personalGmail: text(),
|
||||||
@@ -274,4 +279,3 @@ export const admins = pgTable('admins', {
|
|||||||
.$onUpdate(() => new Date())
|
.$onUpdate(() => new Date())
|
||||||
.notNull(),
|
.notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user