Repository navigation
[PAI-2143] feat: change a workspace member's role #66
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
Merged
akhil-vamshi-konam
merged 1 commit into
release-0.3.2
from
feat/pai-2143-workspace-member-role
Nov 18, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import nock from "nock"; | ||
| import { PlaneClient } from "../../src/client/plane-client"; | ||
|
|
||
| const BASE = "https://plane.test"; | ||
| const SLUG = "acme"; | ||
| const USER_ID = "5d7d9a3e-8f0a-4c55-9b6e-2f1b8c1d0e11"; | ||
|
|
||
| describe("Workspace.updateMemberRole (offline)", () => { | ||
| const client = new PlaneClient({ baseUrl: BASE, apiKey: "test-key" }); | ||
|
|
||
| afterEach(() => nock.cleanAll()); | ||
|
|
||
| it("PATCHes the member by user id with the role slug and returns the member", async () => { | ||
| const scope = nock(BASE) | ||
| .patch(`/api/v1/workspaces/${SLUG}/members/${USER_ID}/`, { role_slug: "guest" }) | ||
| .reply(200, { id: USER_ID, role: 5, role_slug: "guest" }); | ||
|
|
||
| const member = await client.workspace.updateMemberRole(SLUG, USER_ID, "guest"); | ||
|
|
||
| expect(member.role_slug).toBe("guest"); | ||
| expect(scope.isDone()).toBe(true); | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate the v2 workspace-member entries; do not hand-add them to
constants.ts.src/api/v2/generated/constants.tsdeclares that it is generated and must not be edited by hand. This PR adds theworkspace_members_partial_updateid, itsFIELDSentry, and itsEXPANDentry directly to that file. The entries must come from the api_v2 OpenAPI golden throughpnpm codegen:v2 <path-to>/api_v2/core/schema/openapi.Confirm that the golden declares
workspace_members_partial_updatewith itsfieldsandexpandparameters. If it does, regenerate and keep only the output the generator produces. If it does not, add the operation to the golden first. Do not add the entries toscripts/generate-v2-constants.mjs; the generator reads them from the golden.Without a golden entry, the next regeneration can remove these three entries. That removal can break the
updateregistration insrc/api/v2/WorkspaceMembers.ts:14at type-check time.Source: Coding guidelines