Compare commits
3 Commits
7308bd8d03
...
62887548cf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62887548cf | ||
|
|
8715d8e94e | ||
|
|
868f5038b0 |
@ -12,7 +12,7 @@ import {checkIfCurrentDate} from "../../utils/dateUtils";
|
||||
|
||||
const schema = z.object({
|
||||
markTime: z.string().nonempty({message:"Time is required"}),
|
||||
description:z.string().optional()
|
||||
description:z.string().max(200,"description should less than 200 chracters").optional()
|
||||
});
|
||||
|
||||
const CheckCheckOutmodel = ({modeldata,closeModal,handleSubmitForm,}) => {
|
||||
@ -30,6 +30,7 @@ const CheckCheckOutmodel = ({modeldata,closeModal,handleSubmitForm,}) => {
|
||||
setValue,
|
||||
} = useForm({
|
||||
resolver: zodResolver( schema ),
|
||||
mode:"onChange"
|
||||
});
|
||||
|
||||
const onSubmit = ( data ) =>
|
||||
@ -85,6 +86,7 @@ const CheckCheckOutmodel = ({modeldata,closeModal,handleSubmitForm,}) => {
|
||||
name="description"
|
||||
className="form-control"
|
||||
{...register( "description" )}
|
||||
maxLength={200}
|
||||
/>
|
||||
{errors.description && (
|
||||
<p className="text-danger">{errors.description.message}</p>
|
||||
|
||||
@ -121,6 +121,7 @@ const ManageEmployee = () => {
|
||||
register,
|
||||
control,
|
||||
handleSubmit,
|
||||
watch,
|
||||
formState: { errors },
|
||||
reset,
|
||||
getValues,
|
||||
@ -144,8 +145,11 @@ const ManageEmployee = () => {
|
||||
PhoneNumber: currentEmployee?.phoneNumber || "",
|
||||
JobRoleId: currentEmployee?.jobRoleId || "",
|
||||
},
|
||||
mode: "onChange",
|
||||
});
|
||||
|
||||
const AadharNumberValue = watch("AadharNumber") || "";
|
||||
|
||||
const onSubmit = (data) => {
|
||||
setLoading(true);
|
||||
|
||||
@ -338,6 +342,7 @@ const ManageEmployee = () => {
|
||||
{...register("PhoneNumber")}
|
||||
className="form-control form-control-sm"
|
||||
placeholder="Phone Number"
|
||||
inputMode="numeric"
|
||||
/>
|
||||
{errors.PhoneNumber && (
|
||||
<div
|
||||
@ -430,6 +435,7 @@ const ManageEmployee = () => {
|
||||
aria-label="Current Address"
|
||||
aria-describedby="basic-icon-default-message2"
|
||||
{...register( "CurrentAddress" )}
|
||||
maxLength={500}
|
||||
></textarea>
|
||||
{errors.CurrentAddress && (
|
||||
<div
|
||||
@ -452,6 +458,7 @@ const ManageEmployee = () => {
|
||||
aria-label="Permanent Address"
|
||||
aria-describedby="basic-icon-default-message2"
|
||||
{...register( "PermanentAddress" )}
|
||||
maxLength={500}
|
||||
></textarea>
|
||||
{errors.PermanentAddress && (
|
||||
<div
|
||||
@ -507,6 +514,7 @@ const ManageEmployee = () => {
|
||||
{...register("EmergencyContactPerson")}
|
||||
className="form-control form-control-sm"
|
||||
id="EmergencyContactPerson"
|
||||
maxLength={50}
|
||||
placeholder="Contact Person"
|
||||
/>
|
||||
{errors.EmergencyContactPerson && (
|
||||
@ -528,6 +536,7 @@ const ManageEmployee = () => {
|
||||
className="form-control form-control-sm phone-mask"
|
||||
id="EmergencyPhoneNumber"
|
||||
placeholder="Phone Number"
|
||||
inputMode="numeric"
|
||||
/>
|
||||
{errors.EmergencyPhoneNumber && (
|
||||
<div
|
||||
@ -549,6 +558,8 @@ const ManageEmployee = () => {
|
||||
className="form-control form-control-sm"
|
||||
id="AadharNumber"
|
||||
placeholder="AADHAR Number"
|
||||
maxLength={12}
|
||||
inputMode="numeric"
|
||||
/>
|
||||
{errors.AadharNumber && (
|
||||
<div className="danger-text text-start">
|
||||
@ -565,6 +576,7 @@ const ManageEmployee = () => {
|
||||
className="form-control form-control-sm"
|
||||
id="PanNumber"
|
||||
placeholder="PAN Number"
|
||||
maxLength={10}
|
||||
/>
|
||||
{errors.PanNumber && (
|
||||
<div
|
||||
|
||||
@ -62,7 +62,9 @@ const ManageProjectInfo = ( {project,handleSubmitForm, onClose} ) =>
|
||||
endDate: formatDate(project?.endDate ) || currentDate,
|
||||
projectStatusId: String(project?.projectStatusId || "0"),
|
||||
|
||||
}
|
||||
},
|
||||
mode:"onChange"
|
||||
|
||||
})
|
||||
|
||||
useEffect( () =>
|
||||
@ -210,7 +212,7 @@ const ManageProjectInfo = ( {project,handleSubmitForm, onClose} ) =>
|
||||
name="projectAddress"
|
||||
className="form-control"
|
||||
{...register( "projectAddress" )}
|
||||
|
||||
maxLength={500}
|
||||
/>
|
||||
</div>
|
||||
{errors.projectAddress && <div className="danger-text text-start" style={{fontSize:"12px"}}>{errors.projectAddress.message}</div>}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user