add pesel to form

This commit is contained in:
Patryk Drzewiński 2022-06-12 18:31:01 +02:00
parent 04f446e013
commit 52ba3313fb
2 changed files with 18 additions and 0 deletions

View File

@ -11,6 +11,7 @@ export interface Student {
first_name: string first_name: string
last_name: string last_name: string
index: number index: number
pesel: string
mode: boolean mode: boolean
group?: any group?: any
} }

View File

@ -87,6 +87,23 @@ const AddStudent = () => {
<InputError>Indeks musi mieć 6 cyfr</InputError> <InputError>Indeks musi mieć 6 cyfr</InputError>
)} )}
</div> </div>
<div className="form-control">
<label className="label" htmlFor="pesel">
Pesel
</label>
<input
className="input input-bordered"
id="pesel"
type="text"
{...register('pesel', {
required: false,
pattern: /^[0-9]{11}$/,
})}
/>
{errors.pesel?.type === 'pattern' && (
<InputError>Pesel musi mieć 11 cyfr</InputError>
)}
</div>
<div className="form-control gap-2"> <div className="form-control gap-2">
<label className="label">Tryb studiów</label> <label className="label">Tryb studiów</label>
<div className="flex gap-2"> <div className="flex gap-2">