fix: check for single email in TextAreaField (#10149)

Co-authored-by: Dewansh Chaudhari <[email protected]>
Co-authored-by: sean-brydon <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-07-17 20:12:12 +00:00
1 parent 07b43e107e
commit 6c058d041a
2 files changed
+10 -4

No files matched your search

@@ -76,7 +76,11 @@ export const AddNewOrgAdminsForm = () => {
required
value={value}
onChange={(e) => {
const emails = e.target.value.split(",").map((email) => email.trim().toLocaleLowerCase());
const targetValues = e.target.value.split(",");
const emails =
targetValues.length === 1
? targetValues[0].trim().toLocaleLowerCase()
: targetValues.map((email) => email.trim().toLocaleLowerCase());
return onChange(emails);
}}
@@ -236,9 +236,11 @@ export default function MemberInvitationModal(props: MemberInvitationModalProps)
required
value={value}
onChange={(e) => {
const emails = e.target.value
.split(",")
.map((email) => email.trim().toLocaleLowerCase());
const targetValues = e.target.value.split(",");
const emails =
targetValues.length === 1
? targetValues[0].trim().toLocaleLowerCase()
: targetValues.map((email) => email.trim().toLocaleLowerCase());
return onChange(emails);
}}