fix: fixes PIN 4 digit length error (#6265)

This commit is contained in:
Anshuman Pandey
2025-07-21 13:00:03 +05:30
committed by GitHub
parent b35cabcbcc
commit 31bcf98779
2 changed files with 4 additions and 1 deletions

View File

@@ -420,6 +420,8 @@ export const ResponseOptionsCard = ({
/>
</div>
</AdvancedOptionToggle>
{/* Protect Survey with Pin */}
<AdvancedOptionToggle
htmlId="protectSurveyWithPin"
isChecked={isPinProtectionEnabled}
@@ -442,6 +444,7 @@ export const ResponseOptionsCard = ({
defaultValue={localSurvey.pin ? localSurvey.pin : undefined}
onKeyDown={handleSurveyPinInputKeyDown}
onChange={(e) => handleProtectSurveyPinChange(e.target.value)}
maxLength={4}
/>
{verifyProtectWithPinError && (
<p className="pt-1 text-sm text-red-700">{verifyProtectWithPinError}</p>

View File

@@ -849,7 +849,7 @@ export const ZSurvey = z
recaptcha: ZSurveyRecaptcha.nullable(),
isSingleResponsePerEmailEnabled: z.boolean(),
isBackButtonHidden: z.boolean(),
pin: z.string().min(4, { message: "PIN must be a four digit number" }).nullish(),
pin: z.string().length(4, { message: "PIN must be a four digit number" }).nullish(),
resultShareKey: z.string().nullable(),
displayPercentage: z.number().min(0.01).max(100).nullable(),
languages: z.array(ZSurveyLanguage),