Commit ccf28d83 by Finley Ge Committed by GitHub

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

parent 420aaad4
...@@ -86,9 +86,12 @@ export async function addSourceMember<T extends { tmbId: string }>({ ...@@ -86,9 +86,12 @@ export async function addSourceMember<T extends { tmbId: string }>({
}): Promise<Array<T & { sourceMember: SourceMemberType }>> { }): Promise<Array<T & { sourceMember: SourceMemberType }>> {
if (!Array.isArray(list)) return []; if (!Array.isArray(list)) return [];
const tmbIdList = list
.map((item) => (item.tmbId ? String(item.tmbId) : undefined))
.filter(Boolean);
const tmbList = await MongoTeamMember.find( const tmbList = await MongoTeamMember.find(
{ {
_id: { $in: list.map((item) => String(item.tmbId)) } _id: { $in: tmbIdList }
}, },
'tmbId name avatar status', 'tmbId name avatar status',
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment