perf: member group (#4324)

* sync collection

* remove lock

* perf: member group
This commit is contained in:
Archer
2025-03-26 00:02:14 +08:00
committed by archer
parent 64fb09146f
commit 4871a6980f
14 changed files with 213 additions and 255 deletions

View File

@@ -55,6 +55,14 @@ async function getTeamMember(match: Record<string, any>): Promise<TeamTmbItemTyp
};
}
export const getTeamOwner = async (teamId: string) => {
const tmb = await MongoTeamMember.findOne({
teamId,
role: TeamMemberRoleEnum.owner
}).lean();
return tmb;
};
export async function getTmbInfoByTmbId({ tmbId }: { tmbId: string }) {
if (!tmbId) {
return Promise.reject('tmbId or userId is required');