Skip to content

Commit 34a5ca6

Browse files
committed
test(workspaces): prove v2 member management in-process against PostgreSQL
Replace the running-app E2E script with an integration suite that drives the real v2 member route handlers with hashed personal keys, a workspace key, and OAuth tokens against PostgreSQL, including a SCIM-managed member. Simplify the store-failure mapping with findCause and a status table, and keep the store's HTTP error as the cause of a coded refusal so the internal permissions route renders it exactly as before. Spread params and body in the PATCH route like the organization member route, trim comments, and list the renamed member commands in the Teammates settings section.
1 parent f95583c commit 34a5ca6

7 files changed

Lines changed: 574 additions & 578 deletions

File tree

‎apps/sim/app/api/v2/workspaces/[workspaceId]/members/[userId]/route.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ export const PATCH = defineV2JsonRoute({
1919
auth: v2ApiKeyAuth,
2020
rateLimit: v2RateLimits.publicApi,
2121
errorPolicy: v2WorkspaceErrorPolicies.manageWorkspaceMembers,
22-
mapInput: ({ params, body }) => ({
23-
workspaceId: params.workspaceId,
24-
userId: params.userId,
25-
role: body.role,
26-
}),
22+
mapInput: ({ params, body }) => ({ ...params, ...body }),
2723
useCase: updateWorkspaceMember,
2824
present: ({ member }) => ({ data: presentWorkspaceMember(member) }),
2925
})

‎apps/sim/lib/settings/sections.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ export const settingsSections: Record<MothershipSettingsScope, readonly Settings
112112
id: 'teammates',
113113
label: 'Teammates',
114114
uiSection: 'teammates',
115-
cli: ['workspaces members', 'workspaces invitations create'],
115+
cli: [
116+
'workspaces members list',
117+
'workspaces members update',
118+
'workspaces members remove',
119+
'workspaces invitations create',
120+
],
116121
},
117122
{
118123
id: 'secrets',

0 commit comments

Comments
 (0)