fix(invitations): Support both platform and staff invitation types

- Update useInvitationDetails to try platform tenant invitation first,
  then fall back to staff invitation
- Update useAcceptInvitation to handle both invitation types
- Update useDeclineInvitation to handle both invitation types
- Pass invitation type from AcceptInvitePage to mutations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-03 15:49:59 -05:00
parent 4f515c3710
commit abf67a36ed
2 changed files with 46 additions and 9 deletions

View File

@@ -68,6 +68,7 @@ const AcceptInvitePage: React.FC = () => {
firstName: firstName.trim(),
lastName: lastName.trim(),
password,
invitationType: invitation?.invitation_type,
});
// Set auth tokens and redirect to dashboard
@@ -89,7 +90,7 @@ const AcceptInvitePage: React.FC = () => {
}
try {
await declineInvitationMutation.mutateAsync(token!);
await declineInvitationMutation.mutateAsync({ token: token!, invitationType: invitation?.invitation_type });
setDeclined(true);
} catch (err: any) {
setFormError(err.response?.data?.error || t('acceptInvite.declineFailed', 'Failed to decline invitation'));