feat: show revenue amount on event list (if revenue)

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-12-15 22:10:45 +01:00
parent a2a53cf9f7
commit 3b74d8ae36
3 changed files with 10 additions and 3 deletions

View File

@@ -592,6 +592,9 @@ export async function getEventList(options: GetEventListOptions) {
if (select.sdkVersion) {
sb.select.sdkVersion = 'sdk_version';
}
if (select.revenue) {
sb.select.revenue = 'revenue';
}
if (profileId) {
sb.where.deviceId = `(device_id IN (SELECT device_id as did FROM ${TABLE_NAMES.events} WHERE project_id = ${sqlstring.escape(projectId)} AND device_id != '' AND profile_id = ${sqlstring.escape(profileId)} group by did) OR profile_id = ${sqlstring.escape(profileId)})`;

View File

@@ -10,12 +10,10 @@ import {
convertClickhouseDateToJs,
db,
eventService,
formatClickhouseDate,
getChartStartEndDate,
getConversionEventNames,
getEventList,
getEventMetasCached,
getEvents,
getSettingsForProject,
overviewService,
sessionService,
@@ -143,6 +141,7 @@ export const eventRouter = createTRPCRouter({
path: columnVisibility?.name ?? true,
duration: columnVisibility?.name ?? true,
projectId: false,
revenue: true,
},
});
@@ -221,6 +220,7 @@ export const eventRouter = createTRPCRouter({
path: columnVisibility?.name ?? true,
duration: columnVisibility?.name ?? true,
projectId: false,
revenue: true,
},
custom: (sb) => {
sb.where.name = `name IN (${filteredConversions.map((event) => sqlstring.escape(event.name)).join(',')})`;