diff --git a/src/services/platform.service.ts b/src/services/platform.service.ts index 4b880ae2..e8dca65d 100644 --- a/src/services/platform.service.ts +++ b/src/services/platform.service.ts @@ -193,8 +193,9 @@ const checkSinglePlatformConnection = async (communityId: Types.ObjectId, Platfo const reconnectOrAddNewPlatform = async (communityId: Types.ObjectId, PlatformBody: IPlatform): Promise> => { let platformDoc = await getPlatformByFilter({ community: communityId, - disconnectedAt: { $ne: null }, // Check for platforms that are disconnected - name: PlatformBody.name + disconnectedAt: { $ne: null }, // Check for platform if it is disconnected + name: PlatformBody.name, + 'metadata.id': PlatformBody.metadata?.id });