mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: members list endpoint authorization (#2571)
* fix: members list endpoint authorization * chore: update user types
This commit is contained in:
parent
49fd4427c8
commit
705b33377c
@ -38,7 +38,7 @@ export const ProjectAuthWrapper: FC<IProjectAuthWrapper> = observer((props) => {
|
||||
: null
|
||||
);
|
||||
// fetching user project member information
|
||||
const { data: projectMemberInfo } = useSWR(
|
||||
useSWR(
|
||||
workspaceSlug && projectId ? `PROJECT_MEMBERS_ME_${workspaceSlug}_${projectId}` : null,
|
||||
workspaceSlug && projectId
|
||||
? () => userStore.fetchUserProjectInfo(workspaceSlug.toString(), projectId.toString())
|
||||
@ -53,10 +53,8 @@ export const ProjectAuthWrapper: FC<IProjectAuthWrapper> = observer((props) => {
|
||||
);
|
||||
// fetching project members
|
||||
useSWR(
|
||||
workspaceSlug && projectId && projectMemberInfo && [20, 15].includes(projectMemberInfo.role)
|
||||
? `PROJECT_MEMBERS_${workspaceSlug}_${projectId}`
|
||||
: null,
|
||||
workspaceSlug && projectId && projectMemberInfo && [20, 15].includes(projectMemberInfo.role)
|
||||
workspaceSlug && projectId ? `PROJECT_MEMBERS_${workspaceSlug}_${projectId}` : null,
|
||||
workspaceSlug && projectId
|
||||
? () => projectStore.fetchProjectMembers(workspaceSlug.toString(), projectId.toString())
|
||||
: null
|
||||
);
|
||||
|
@ -22,7 +22,7 @@ export const WorkspaceAuthWrapper: FC<IWorkspaceAuthWrapper> = observer((props)
|
||||
// fetching all workspaces
|
||||
useSWR(`USER_WORKSPACES_LIST`, () => workspaceStore.fetchWorkspaces());
|
||||
// fetching user workspace information
|
||||
const { data: workspaceMemberInfo } = useSWR(
|
||||
useSWR(
|
||||
workspaceSlug ? `WORKSPACE_MEMBERS_ME_${workspaceSlug}` : null,
|
||||
workspaceSlug ? () => userStore.fetchUserWorkspaceInfo(workspaceSlug.toString()) : null
|
||||
);
|
||||
@ -33,12 +33,8 @@ export const WorkspaceAuthWrapper: FC<IWorkspaceAuthWrapper> = observer((props)
|
||||
);
|
||||
// fetch workspace members
|
||||
useSWR(
|
||||
workspaceSlug && workspaceMemberInfo && [20, 15].includes(workspaceMemberInfo.role)
|
||||
? `WORKSPACE_MEMBERS_${workspaceSlug}`
|
||||
: null,
|
||||
workspaceSlug && workspaceMemberInfo && [20, 15].includes(workspaceMemberInfo.role)
|
||||
? () => workspaceStore.fetchWorkspaceMembers(workspaceSlug.toString())
|
||||
: null
|
||||
workspaceSlug ? `WORKSPACE_MEMBERS_${workspaceSlug}` : null,
|
||||
workspaceSlug ? () => workspaceStore.fetchWorkspaceMembers(workspaceSlug.toString()) : null
|
||||
);
|
||||
// fetch workspace labels
|
||||
useSWR(
|
||||
|
2
web/types/users.d.ts
vendored
2
web/types/users.d.ts
vendored
@ -64,7 +64,7 @@ export interface IUserLite {
|
||||
}
|
||||
|
||||
export interface IUserMemberLite extends IUserLite {
|
||||
email: string;
|
||||
email?: string;
|
||||
}
|
||||
|
||||
export interface IUserActivity {
|
||||
|
Loading…
Reference in New Issue
Block a user