Add updateWorkspaceMember action to change workspace roles#20
Add updateWorkspaceMember action to change workspace roles#20
Conversation
✅ Deploy Preview for mongoose-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| member.roles = [role]; | ||
| await workspace.save(); | ||
|
|
There was a problem hiding this comment.
Enforce subscription limits before promoting members
The new action sets member.roles and saves the workspace without checking whether the workspace has a paid subscription or available seats when elevating someone from a free dashboards role to admin/member. inviteToWorkspace explicitly blocks adding paid members on non‑pro plans (subscriptionTier !== 'pro' and numPaidUsers > 0), but this update path skips that validation, so an admin can invite a user as a free dashboards member and immediately promote them to a paid role without triggering any billing enforcement or Stripe provisioning.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68ed6bc4aeec8324939b8980fef0b401