mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
fix: app version addSourcemember tmbid could be empty (#3822)
This commit is contained in:
@@ -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',
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user