Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

📈 Track poll response by creator

Luke Vellabdb771e35234
diff --git a/apps/web/src/features/poll/analytics.ts b/apps/web/src/features/poll/analytics.ts
index e1cf1e57e..6a09635fd 100644
--- a/apps/web/src/features/poll/analytics.ts
+++ b/apps/web/src/features/poll/analytics.ts
@@ -128,6 +128,7 @@ export interface PollResponseSubmitEvent extends BaseEventData {
participantId: string;
hasEmail: boolean;
totalResponses: number;
+ isCreator: boolean;
};
}
diff --git a/apps/web/src/trpc/routers/polls/participants.ts b/apps/web/src/trpc/routers/polls/participants.ts
index bf2331836..8b818c4c2 100644
--- a/apps/web/src/trpc/routers/polls/participants.ts
+++ b/apps/web/src/trpc/routers/polls/participants.ts
@@ -184,6 +184,8 @@ export const participants = router({
select: {
id: true,
title: true,
+ userId: true,
+ guestId: true,
},
},
},
@@ -258,6 +260,9 @@ export const participants = router({
participantId: participant.id,
hasEmail: !!email,
totalResponses,
+ isCreator: ctx.user.isGuest
+ ? participant.poll.guestId === ctx.user.id
+ : participant.poll.userId === ctx.user.id,
},
});