diff --git a/src/endpoints/statistics/index.ts b/src/endpoints/statistics/index.ts index 0af9436..4031cca 100644 --- a/src/endpoints/statistics/index.ts +++ b/src/endpoints/statistics/index.ts @@ -296,7 +296,15 @@ export const fetchTopDiagnosis = async (client: Client): Promise => }; export const fetchMemberStats = async (client: Client): Promise => { - if (project === PROJECT_INCLUDE) return; + const membersExists = await client.indices.exists({ + index: 'members', + }); + + const publicMembersExists = await client.indices.exists({ + index: 'members-public', + }); + + if (!membersExists?.body || !publicMembersExists?.body) return; const { body: members } = await client.count({ index: 'members',