You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Queue emails for sending - no need to await since it's handled by queue
@@ -725,24 +780,50 @@ export async function bulkInviteUsers({
725
780
senderId: userId,
726
781
});
727
782
728
-
constskippedUsers=users.filter(
729
-
(user)=>
730
-
existingInviteEmails.includes(user.email)||
731
-
existingEmailsInOrg.has(user.email)
732
-
);
783
+
constskippedUsers=users.filter((user)=>{
784
+
if(existingInviteEmails.includes(user.email)){
785
+
returntrue;
786
+
}
787
+
788
+
if(existingEmailsInOrg.has(user.email)){
789
+
returntrue;
790
+
}
791
+
792
+
if(
793
+
user.teamMemberId&&
794
+
teamMembersWithUserId.includes(user.teamMemberId)
795
+
){
796
+
returntrue;
797
+
}
798
+
799
+
returnfalse;
800
+
});
733
801
734
802
return{
735
803
inviteSentUsers: validPayloads,
736
804
skippedUsers,
737
805
extraMessage:
738
806
createdInvites.length>10
739
-
? "You are sending more than 10 invites, so some of the emails might get slightly delayed. If one of the invitees hasnt received the email within 5-10 minutes, you can use the Resend invite feature to send the email again."
807
+
? "You are sending more than 10 invites, so some of the emails might get slightly delayed. If one of the invitees hasn't received the email within 5-10 minutes, you can use the Resend invite feature to send the email again."
740
808
: undefined,
741
809
};
742
810
}catch(cause){
811
+
letmessage="Something went wrong while inviting users.";
812
+
813
+
if(isLikeShelfError(cause)){
814
+
message=cause.message;
815
+
}
816
+
817
+
if(
818
+
causeinstanceofPrismaClientKnownRequestError&&
819
+
cause.code==="P2003"
820
+
){
821
+
message="Received invalid teamMemberId in csv";
822
+
}
823
+
743
824
thrownewShelfError({
744
825
cause,
745
-
message: "Something went wrong while inviting users.",
0 commit comments