mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
pref: member/group/org (#4316)
* feat: change group owner api * pref: member/org/group * fix: member modal select clb * fix: search member when change owner
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
// orgId, pathid, path === null ===> root org
|
||||
export type postCreateOrgData = {
|
||||
name: string;
|
||||
parentId: string;
|
||||
description?: string;
|
||||
avatar?: string;
|
||||
path?: string;
|
||||
};
|
||||
|
||||
export type putUpdateOrgMembersData = {
|
||||
orgId: string;
|
||||
orgId?: string;
|
||||
members: {
|
||||
tmbId: string;
|
||||
// role: `${OrgMemberRole}`;
|
||||
@@ -14,7 +15,7 @@ export type putUpdateOrgMembersData = {
|
||||
};
|
||||
|
||||
export type putUpdateOrgData = {
|
||||
orgId: string;
|
||||
orgId: string; // can not be undefined because can not uppdate root org
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
description?: string;
|
||||
@@ -22,7 +23,7 @@ export type putUpdateOrgData = {
|
||||
|
||||
export type putMoveOrgType = {
|
||||
orgId: string;
|
||||
targetOrgId: string;
|
||||
targetOrgId?: string; // '' ===> move to root org
|
||||
};
|
||||
|
||||
// type putChnageOrgOwnerData = {
|
||||
|
@@ -3,7 +3,10 @@ import { OrgSchemaType } from './type';
|
||||
export const OrgCollectionName = 'team_orgs';
|
||||
export const OrgMemberCollectionName = 'team_org_members';
|
||||
|
||||
export const getOrgChildrenPath = (org: OrgSchemaType) => `${org.path}/${org.pathId}`;
|
||||
export const getOrgChildrenPath = (org: OrgSchemaType) => {
|
||||
if (org.path === '' && org.pathId === '') return '';
|
||||
return `${org.path ?? ''}/${org.pathId}`;
|
||||
};
|
||||
|
||||
export enum SyncOrgSourceEnum {
|
||||
wecom = 'wecom'
|
||||
|
@@ -21,7 +21,7 @@ type OrgMemberSchemaType = {
|
||||
};
|
||||
|
||||
export type OrgListItemType = OrgSchemaType & {
|
||||
permission: TeamPermission;
|
||||
permission?: TeamPermission;
|
||||
total: number; // members + children orgs
|
||||
};
|
||||
|
||||
|
@@ -4,14 +4,14 @@ import { TeamErrEnum } from '@fastgpt/global/common/error/code/team';
|
||||
import { authUserPer } from '../user/auth';
|
||||
import { ManagePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||
|
||||
/*
|
||||
/*
|
||||
Team manager can control org
|
||||
*/
|
||||
export const authOrgMember = async ({
|
||||
orgIds,
|
||||
...props
|
||||
}: {
|
||||
orgIds: string | string[];
|
||||
orgIds?: string | string[];
|
||||
} & AuthModeType): Promise<AuthResponseType> => {
|
||||
const result = await authUserPer({
|
||||
...props,
|
||||
|
@@ -19,7 +19,7 @@ function AvatarGroup({
|
||||
avatars: string[];
|
||||
total?: number;
|
||||
}) {
|
||||
const remain = total ?? avatars.length - max;
|
||||
const remain = (total ?? avatars.length) - max;
|
||||
return (
|
||||
<Flex position="relative">
|
||||
{avatars.slice(0, max).map((avatar, index) => (
|
||||
|
Reference in New Issue
Block a user