summaryrefslogtreecommitdiff
path: root/src/lib/form
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/form')
-rw-r--r--src/lib/form/components/KunjunganSales.jsx27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/lib/form/components/KunjunganSales.jsx b/src/lib/form/components/KunjunganSales.jsx
index bb7df05b..38a07345 100644
--- a/src/lib/form/components/KunjunganSales.jsx
+++ b/src/lib/form/components/KunjunganSales.jsx
@@ -47,22 +47,20 @@ const KunjunganSales = () => {
return
}
- const descriptions = [
- `Nama Perusahaan: ${values.company}`,
- `No. Telepon: ${values.phone}`,
- `Alamat Lengkap: ${values.address}`,
- `Kota: ${values.city}`,
- `Unit Perusahaan: ${values.companyType}`,
- `No. Handphone: ${values.mobile}`,
- `Alamat Email: ${values.email}`,
- `Keterangan: ${values.description}`
- ]
-
const data = {
- name: `Permintaan Kunjungan Sales - ${values.company}`,
+ name: `Pengajuan Kunjungan Sales - ${values.company}`,
email_from: values.email,
phone: values.phone,
- description: descriptions.join('\n')
+ description: [
+ `Nama Perusahaan: ${values.company}`,
+ `No. Telepon: ${values.phone}`,
+ `Alamat Lengkap: ${values.address}`,
+ `Kota: ${values.city}`,
+ `Unit Perusahaan: ${values.companyType}`,
+ `No. Handphone: ${values.mobile}`,
+ `Alamat Email: ${values.email}`,
+ `Keterangan: ${values.description}`
+ ].join('\n')
}
const createLead = await createLeadApi({ data })
@@ -168,7 +166,6 @@ const KunjunganSales = () => {
<div>
<label className='form-label mb-2'>Keterangan</label>
<textarea {...register('description')} type='text' className='form-input' />
- <div className='text-caption-2 text-danger-500 mt-1'>{errors.description?.message}</div>
</div>
<ReCAPTCHA ref={recaptchaRef} sitekey={process.env.NEXT_PUBLIC_RECAPTCHA_GOOGLE} />
@@ -181,6 +178,7 @@ const KunjunganSales = () => {
</div>
)
}
+
const validationSchema = Yup.object().shape({
email: Yup.string().email('Format harus seperti contoh@email.com').required('Harus di-isi'),
company: Yup.string().required('Harus di-isi'),
@@ -189,6 +187,7 @@ const validationSchema = Yup.object().shape({
address: Yup.string().required('Harus di-isi'),
city: Yup.string().required('Harus dipilih')
})
+
const defaultValues = {
email: '',
company: '',