File tree Expand file tree Collapse file tree
apps/cache_worker/src/activities/dashboard-cache
libs/data-access-layer/src/organizations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export async function getNewMembersTimeseries(
6969export async function getActiveMembersTimeseries (
7070 params : IQueryTimeseriesParams ,
7171) : Promise < ITimeseriesDatapoint [ ] > {
72- return getTimeseriesOfActiveMembers ( dbStoreQx ( qdb ) , params )
72+ return getTimeseriesOfActiveMembers ( dbStoreQx ( svc . postgres . reader ) , params )
7373}
7474
7575export async function getNewOrganizationsTimeseries (
@@ -81,7 +81,7 @@ export async function getNewOrganizationsTimeseries(
8181export async function getActiveOrganizationsTimeseries (
8282 params : IQueryTimeseriesParams ,
8383) : Promise < ITimeseriesDatapoint [ ] > {
84- return getTimeseriesOfActiveOrganizations ( dbStoreQx ( qdb ) , params )
84+ return getTimeseriesOfActiveOrganizations ( dbStoreQx ( svc . postgres . reader ) , params )
8585}
8686
8787export async function getActivitiesNumber ( params : IQueryTimeseriesParams ) : Promise < number > {
Original file line number Diff line number Diff line change @@ -471,10 +471,9 @@ export async function getTimeseriesOfActiveOrganizations(
471471 const query = `
472472 SELECT
473473 COUNT_DISTINCT("organizationId") AS count,
474- DATE_TRUNC('day', timestamp)
475- FROM activities
476- WHERE "deletedAt" IS NULL
477- AND "organizationId" IS NOT NULL
474+ DATE_TRUNC('day', timestamp) as date
475+ FROM "activityRelations"
476+ WHERE "organizationId" IS NOT NULL
478477 ${ params . segmentIds ? 'AND "segmentId" IN ($(segmentIds:csv))' : '' }
479478 AND timestamp >= $(startDate)
480479 AND timestamp < $(endDate)
You can’t perform that action at this time.
0 commit comments