Skip to content

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

Disable editing options for legacy polls

Luke Vella4898b75f9bf4
diff --git a/components/poll/manage-poll.tsx b/components/poll/manage-poll.tsx
index e291a67ce..343bde7de 100644
--- a/components/poll/manage-poll.tsx
+++ b/components/poll/manage-poll.tsx
@@ -167,11 +167,13 @@ const ManagePoll: React.VoidFunctionComponent<{
label="Edit details"
onClick={openChangePollDetailsModa}
/>
- <DropdownItem
- icon={Table}
- label="Edit options"
- onClick={openChangeOptionsModal}
- />
+ {!poll.legacy ? (
+ <DropdownItem
+ icon={Table}
+ label="Edit options"
+ onClick={openChangeOptionsModal}
+ />
+ ) : null}
<DropdownItem
icon={Save}
label="Export to CSV"
diff --git a/pages/api/poll/[urlId]/index.ts b/pages/api/poll/[urlId]/index.ts
index 7a7fe70fe..0d90b43cc 100644
--- a/pages/api/poll/[urlId]/index.ts
+++ b/pages/api/poll/[urlId]/index.ts
@@ -1,7 +1,6 @@
import { GetPollApiResponse } from "api-client/get-poll";
import { NextApiResponse } from "next";
import { resetDates } from "utils/legacy-utils";
-import { getMongoClient } from "utils/mongodb-client";
import { UpdatePollPayload } from "../../../../api-client/update-poll";
import { prisma } from "../../../../db";
import { exclude, withLink } from "../../../../utils/api-utils";