fix: generate single survey Ids in summary only if enabled (#942)

This commit is contained in:
Shubham Palriwala
2023-10-04 16:34:47 +05:30
committed by GitHub
parent cce3a98f20
commit a78c19385e

View File

@@ -30,7 +30,12 @@ export default async function Page({ params }) {
getEnvironment(params.environmentId),
]);
const isSingleUseSurvey = survey.singleUse?.enabled ?? false;
const singleUseIds = generateSingleUseIds(survey.singleUse?.isEncrypted ?? false);
let singleUseIds: string[] | undefined = undefined;
if (isSingleUseSurvey) {
singleUseIds = generateSingleUseIds(survey.singleUse?.isEncrypted ?? false);
}
if (!environment) {
throw new Error("Environment not found");
}