Skip to content

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

🚧 Add support for poll options

Luke Vellae93b36cdae26
diff --git a/apps/web/src/app/api/private/[...route]/route.ts b/apps/web/src/app/api/private/[...route]/route.ts
index 55d735aac..081ef03b5 100644
--- a/apps/web/src/app/api/private/[...route]/route.ts
+++ b/apps/web/src/app/api/private/[...route]/route.ts
@@ -139,6 +139,10 @@ app.post(
title: input.title,
description: input.description,
location: input.location,
+ requireParticipantEmail: input.requireEmail,
+ hideParticipants: input.hideParticipants,
+ hideScores: input.hideScores,
+ disableComments: input.disableComments,
options,
});
@@ -228,6 +232,10 @@ app.post(
description: input.description,
location: input.location,
timeZone,
+ requireParticipantEmail: input.requireEmail,
+ hideParticipants: input.hideParticipants,
+ hideScores: input.hideScores,
+ disableComments: input.disableComments,
options,
});
diff --git a/apps/web/src/app/api/private/schemas.ts b/apps/web/src/app/api/private/schemas.ts
index c824c90a7..c45cbb58a 100644
--- a/apps/web/src/app/api/private/schemas.ts
+++ b/apps/web/src/app/api/private/schemas.ts
@@ -82,6 +82,22 @@ export const createPollInputSchema = z
.max(255)
.optional()
.openapi({ example: "Zoom" }),
+ requireEmail: z.boolean().optional().openapi({
+ description: "Require participants to provide their email address",
+ example: true,
+ }),
+ hideParticipants: z.boolean().optional().openapi({
+ description: "Hide participant names from other participants",
+ example: false,
+ }),
+ hideScores: z.boolean().optional().openapi({
+ description: "Hide vote counts from participants",
+ example: false,
+ }),
+ disableComments: z.boolean().optional().openapi({
+ description: "Disable the comments section",
+ example: false,
+ }),
dates: datesInputSchema.optional(),
slots: slotsInputSchema.optional(),
})
diff --git a/apps/web/src/app/api/private/utils/poll.ts b/apps/web/src/app/api/private/utils/poll.ts
index f92519295..490f0324e 100644
--- a/apps/web/src/app/api/private/utils/poll.ts
+++ b/apps/web/src/app/api/private/utils/poll.ts
@@ -13,6 +13,10 @@ export type CreatePollParams = {
description?: string;
location?: string;
timeZone?: string;
+ requireParticipantEmail?: boolean;
+ hideParticipants?: boolean;
+ hideScores?: boolean;
+ disableComments?: boolean;
options: PollOption[];
};
@@ -22,6 +26,10 @@ export const createPoll = async ({
description,
location,
timeZone,
+ requireParticipantEmail,
+ hideParticipants,
+ hideScores,
+ disableComments,
options,
}: CreatePollParams) => {
const spaceMember = await prisma.spaceMember.findFirst({
@@ -37,6 +45,10 @@ export const createPoll = async ({
description,
location,
timeZone,
+ requireParticipantEmail,
+ hideParticipants,
+ hideScores,
+ disableComments,
adminUrlId: nanoid(),
participantUrlId: nanoid(),
userId,
@@ -44,7 +56,7 @@ export const createPoll = async ({
options: { createMany: { data: options } },
spaceId: spaceMember?.spaceId,
},
- select: { id: true, title: true, location: true, description: true },
+ select: { id: true },
});
return {