fix: duplicate Invite Issue (#96)

* fix: Duplicate Invite Issues.

* fix: Resolved Changes Needed.
This commit is contained in:
Rohit Chaware
2023-12-11 05:47:41 +03:00
committed by GitHub
parent 28e9281fdc
commit 4c3a5e93e6
@@ -38,7 +38,15 @@
let apiError = '';
emails.forEach(async (email, index) => {
if (apiError) return;
const { data, error } = await supabase
const doesEmailExist = $orgTeam.some(teamMember => teamMember.email.toLowerCase() === email.toLowerCase())
if (doesEmailExist) {
snackbar.error("User Already Exists");
isLoading = false;
return;
} else {
const { data, error } = await supabase
.from('organizationmember')
.insert({
organization_id: $currentOrg.id,
@@ -47,7 +55,8 @@
verified: false
})
.select();
console.log('data', data);
console.log('data', data);
}
if (error) {
apiError = error;