This should fix the invites bug when you have incorrect behavior if you invite the same email to different teams.
Problem:
Logic is so that if a user sends an email that is already in the invite list we should just update the existing one instead of creating a new one with the same email.
The issue was the condition that filters existing emails. The condition didn't check the teamId and as a result, if you already have an invite to team A, when you try to create an invite to team B, an invite to team A will be selected as an "invite to update", but not as an "invite to create".
PR also fixes incorrect team names in the invite email
This should fix the invites bug when you have incorrect behavior if you invite the same email to different teams.
Problem:
teamId
and as a result, if you already have an invite to team A, when you try to create an invite to team B, an invite to team A will be selected as an "invite to update", but not as an "invite to create".PR also fixes incorrect team names in the invite email
Screencast updated:
https://github.com/worldcoin/developer-portal/assets/89008845/92752b3f-f089-4205-bb71-4f64a6a8dad6