diff --git a/src/components/process/processStepOne/ProcessStepOne.tsx b/src/components/process/processStepOne/ProcessStepOne.tsx index aa15ed3..48e1bc1 100644 --- a/src/components/process/processStepOne/ProcessStepOne.tsx +++ b/src/components/process/processStepOne/ProcessStepOne.tsx @@ -53,10 +53,30 @@ const ProcessStepOne = () => { }, []) const handleNextClick = async (isSendNow: boolean) => { - if (!selectedDocuments.length || !selectedRecipients.length) { + let formError = { + documents: false, + recipients: false, + subject: false + } + + if (!selectedDocuments.length) { + formError.documents = true + } + if (!selectedRecipients.length) { + formError.recipients = true + } + if (!emailDtls.subject.length) { + formError.subject = true + } + + if (formError.documents || formError.recipients || formError.subject) { console.log(selectedDocuments, 'line 193') toast.dismiss(); - toast.error("Add Documents | Recipients First", { + toast.error(`${formError.documents ? "Add Document" : ""} + ${(formError.documents && formError.recipients) ? " | " : ""} + ${formError.recipients ? "Add Recipient" : ""} + ${(formError.documents || formError.recipients) ? " | " : ""} + ${formError.subject ? "Add Subject" : ""}`, { position: "top-center", autoClose: 5000, hideProgressBar: false, @@ -218,7 +238,8 @@ const ProcessStepOne = () => { setEmailDtls({ ...emailDtls, subject: e.target.value })} placeholder="Email Subject" className="w-full px-3 py-2 rounded border border-gray-300 focus:outline-none focus:ring-2 focus:ring-[var(--primary)]"