Repository navigation
Fixed system owner invitation flow #52
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,9 +90,13 @@ export function InviteUserDialog({ resource = "users" }: Readonly<InviteUserDial | |
| }, [open, roles, form]); | ||
|
|
||
| const onSubmit = (data: InviteUserFormValues) => { | ||
| // Detect if we're in admin context (System Owner) | ||
| const isAdminContext = resource === "admin/users"; | ||
|
|
||
| create( | ||
| { | ||
| resource: "invitations", // Explicitly call invitations endpoint | ||
| // System Owner uses admin endpoint, Tenant Admin uses regular endpoint | ||
| resource: isAdminContext ? "admin/invitations" : "invitations", | ||
|
Comment on lines
92
to
+99
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Good fix — correctly derives admin context from the The change properly addresses the prior feedback by eliminating the ♻️ Optional DRY improvement- // Determine scope based on resource
- const scope = resource === "admin/users" ? "system" : "organization";
+ const isAdminContext = resource === "admin/users";
+ const scope = isAdminContext ? "system" : "organization";Then in const onSubmit = (data: InviteUserFormValues) => {
- // Detect if we're in admin context (System Owner)
- const isAdminContext = resource === "admin/users";
-
create(
{
// System Owner uses admin endpoint, Tenant Admin uses regular endpoint
resource: isAdminContext ? "admin/invitations" : "invitations",🤖 Prompt for AI Agents |
||
| values: { | ||
| ...data, | ||
| // The backend handles organizationId injection based on user token. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.