(e)
| 219 | |
| 220 | |
| 221 | const handleUserData = async (e) => { |
| 222 | e.preventDefault(); |
| 223 | if (!emailRegex.test(contact.email?.toLowerCase()?.replace(/\s/g, ""))) { |
| 224 | alert(t("valid-email-alert")); |
| 225 | } else { |
| 226 | const params = { ...contact, docId: documentId }; |
| 227 | try { |
| 228 | setLoading(true); |
| 229 | const linkContactRes = await Parse.Cloud.run( |
| 230 | "linkcontacttodoc", |
| 231 | params |
| 232 | ); |
| 233 | setContactId(linkContactRes.contactId); |
| 234 | const IsEnableOTP = await navigateToDoc( |
| 235 | documentId, |
| 236 | linkContactRes.contactId |
| 237 | ); |
| 238 | if (!IsEnableOTP) { |
| 239 | setEnterOtp(true); |
| 240 | await SendOtp(); |
| 241 | } |
| 242 | } catch (err) { |
| 243 | setLoading(false); |
| 244 | alert(t("something-went-wrong-mssg")); |
| 245 | console.log("Err in link ext contact", err); |
| 246 | } |
| 247 | } |
| 248 | }; |
| 249 | |
| 250 | const handleInputChange = (e) => { |
| 251 | if (e.target.name === "email") { |
nothing calls this directly
no test coverage detected