feat: global platform v2 update
This commit is contained in:
36
lib/api/members.ts
Normal file
36
lib/api/members.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
// ============================================================================
|
||||
// Workspace Members API
|
||||
// ============================================================================
|
||||
|
||||
import { api } from "./client";
|
||||
import type {
|
||||
WorkspaceMember,
|
||||
UpdatePermissionsRequest,
|
||||
PaginatedResponse,
|
||||
PaginationParams,
|
||||
} from "@/lib/types/api";
|
||||
|
||||
export const membersApi = {
|
||||
/**
|
||||
* Get list of workspace members
|
||||
*/
|
||||
list: (workspaceId: string, params?: PaginationParams) =>
|
||||
api.get<PaginatedResponse<WorkspaceMember>>(
|
||||
`/workspaces/${workspaceId}/members`,
|
||||
{ params }
|
||||
),
|
||||
|
||||
/**
|
||||
* Update member permissions
|
||||
*/
|
||||
updatePermissions: (
|
||||
workspaceId: string,
|
||||
userId: string,
|
||||
data: UpdatePermissionsRequest
|
||||
) =>
|
||||
api.put<WorkspaceMember>(
|
||||
`/workspaces/${workspaceId}/members/${userId}/permissions`,
|
||||
data
|
||||
),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user