Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(member-invites): show role error messages #85912

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ export default function useInviteModal({organization, initialData, source}: Prop
// Use the email error message if available. This inconsistently is
// returned as either a list of errors for the field, or a single error.
const emailError =
!errorResponse || !errorResponse.email
!errorResponse ||
(!errorResponse.email
? false
: Array.isArray(errorResponse.email)
? errorResponse.email[0]
: errorResponse.email;
: errorResponse.email) ||
(!errorResponse.role ? false : errorResponse.role);

const orgLevelError = errorResponse?.organization;
const error = orgLevelError || emailError || t('Could not invite user');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function TeamRow({

const GRID_TEMPLATE = `
display: grid;
grid-template-columns: minmax(100px, 1fr) minmax(0px, 100px) 200px 95px;
grid-template-columns: minmax(100px, 1fr) minmax(0px, 100px) 200px;
gap: ${space(1)};
> div:last-child {
Expand Down
Loading