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

Co-authored-by: Dewansh Chaudhari <codewansh@Dewanshs-MacBook-Pro.local>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
pull/10201/head^2
Dewansh Chaudhari 2023-07-18 01:42:12 +05:30 committed by GitHub
parent 07b43e107e
commit 6c058d041a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -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);
}}

View File

@ -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);
}}