Inviting users that have practitioner records crea...
# support
t
Hi! I'm inviting Practitioners to our application via the
/admin/projects/{projectId}/invite
route and noticed we're getting duplicate user accounts if we re-run the invite on an existing user. Our use-case requires that an invite be idempotent and we were hoping that the User would be deduped much like the Profile. After digging a little bit I noticed in the
invite.ts
you de-dupe User for
Patient
invites but not
Practitioner
. Just wanted to see if this is intentional or not! Github issue here if this is a real issue: https://github.com/medplum/medplum/issues/3369 Thanks
I just realized the project user's tab is showing
ProjectMembership
and not actual users. I can see that the
ProjectMembership
is a M:1 with user.. that clears things up a bit! Can close this. Thanks!
r
Hi Taylor! You've actually hit on a real pain point, that we plan on addressing here: https://github.com/medplum/medplum/issues/3137. Having 2 ProjectMemberships for the same user generally leads to undefined behavior, and we'd like to clean this up 🙂
t
Awesome! As a workaround we’re looking up a practitioner’s ProjectMembership and based on its existence deciding wether to invite or not. This should work for us for now.