fix: app version addSourcemember tmbid could be empty (#3822)

This commit is contained in:
Finley Ge
2025-02-18 20:26:49 +08:00
committed by GitHub
parent 420aaad48e
commit ccf28d83b8

View File

@@ -86,9 +86,12 @@ export async function addSourceMember<T extends { tmbId: string }>({
}): Promise<Array<T & { sourceMember: SourceMemberType }>> {
if (!Array.isArray(list)) return [];
const tmbIdList = list
.map((item) => (item.tmbId ? String(item.tmbId) : undefined))
.filter(Boolean);
const tmbList = await MongoTeamMember.find(
{
_id: { $in: list.map((item) => String(item.tmbId)) }
_id: { $in: tmbIdList }
},
'tmbId name avatar status',
{