Skip to content

add roleSlug for createOrgMembership and fix updateOrgMemberhship#278

Merged
jameslcarpino merged 2 commits into
mainfrom
jc-add-role-slug-to-create-org
May 9, 2025
Merged

add roleSlug for createOrgMembership and fix updateOrgMemberhship#278
jameslcarpino merged 2 commits into
mainfrom
jc-add-role-slug-to-create-org

Conversation

@jameslcarpino

Copy link
Copy Markdown
Contributor

Description

adds roleSlug param on createOrgMembership. Allows for updateOrgMembership to not require roleSlug.

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@jameslcarpino jameslcarpino requested a review from a team as a code owner May 6, 2025 17:21
@jameslcarpino jameslcarpino requested a review from nicknisi May 6, 2025 17:21

@mattgd mattgd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment but looks good otherwise.

Comment thread tests/WorkOS/UserManagementTest.php Outdated
Comment on lines +863 to +864
echo "Response from Create Org:";
print_r($response);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was just for debugging and probably meant to be removed.

Comment thread lib/UserManagement.php Outdated
);
if (!is_null($roleSlug) && !is_string($roleSlug)) {
throw new \InvalidArgumentException("roleSlug must be a string or null");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't generally do runtime type checks for parameters like this. The typehint phpdoc comment should be enough.

@jameslcarpino jameslcarpino requested review from gcarvelli and mattgd May 7, 2025 17:44
@jameslcarpino jameslcarpino merged commit 0f29f1e into main May 9, 2025
5 checks passed
@jameslcarpino jameslcarpino deleted the jc-add-role-slug-to-create-org branch May 9, 2025 16:51
cmatheson added a commit that referenced this pull request May 22, 2025
includes:
* #278
* #285
@cmatheson cmatheson mentioned this pull request May 22, 2025
cmatheson added a commit that referenced this pull request May 22, 2025
includes:
* #278
* #285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants