Skip to content
This repository was archived by the owner on Nov 29, 2025. It is now read-only.

Conversation

@ashwin31
Copy link
Member

No description provided.

This commit introduces functionality for users to add new members to their currently selected organization.

Key changes include:
- A new route at /app/users/new with a Svelte form (+page.svelte) for capturing new user details (email, name, role).
- Server-side logic (+page.server.js) to handle form submission:
    - Validates input data.
    - Checks if the user already exists globally. If so, and not already in the current organization, adds them.
    - If the user does not exist globally, creates a new user record.
    - Creates a UserOrganization record to link the user to the active organization with the specified role (ADMIN or USER).
    - Provides feedback (success/error messages) to you.
- The current user's organization is determined from event.locals.org as established by hooks.server.js.
- For this initial implementation, any user within an organization can add new users to it.
@ashwin31 ashwin31 merged commit 7ac4c99 into main May 24, 2025
4 checks passed
@ashwin31 ashwin31 deleted the feat/add-user-to-org branch May 24, 2025 03:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants