From b1a7790dd1bc7ec7e035c06f29a5f99210f7f377 Mon Sep 17 00:00:00 2001 From: Kathleen Koh <89055608+kathleenkhy@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:26:03 +0800 Subject: [PATCH] fix(mrf): remove any response limits for MRF (#7214) * fix: set submission limit to null for MRF * chore: improve explanation comments on reasons for removing submission limit --- src/app/modules/form/admin-form/admin-form.service.ts | 7 +++++++ src/app/modules/form/admin-form/admin-form.types.ts | 1 + 2 files changed, 8 insertions(+) diff --git a/src/app/modules/form/admin-form/admin-form.service.ts b/src/app/modules/form/admin-form/admin-form.service.ts index a2466c32b3..393d028466 100644 --- a/src/app/modules/form/admin-form/admin-form.service.ts +++ b/src/app/modules/form/admin-form/admin-form.service.ts @@ -600,6 +600,13 @@ export const duplicateForm = ( overrideProps.endPage = omit(originalForm.endPage, 'buttonLink') } + // if MRF, set submissionLimit = null + // this is because MRF does not support submission limit (i.e. response limit) + + if (overrideProps.responseMode === FormResponseMode.Multirespondent) { + overrideProps.submissionLimit = null + } + const duplicateParams = originalForm.getDuplicateParams(overrideProps) if (workspaceId) diff --git a/src/app/modules/form/admin-form/admin-form.types.ts b/src/app/modules/form/admin-form/admin-form.types.ts index 28ec42a8c2..c4e20b0558 100644 --- a/src/app/modules/form/admin-form/admin-form.types.ts +++ b/src/app/modules/form/admin-form/admin-form.types.ts @@ -30,6 +30,7 @@ export type OverrideProps = { responseMode: FormResponseMode emails?: string | string[] publicKey?: string + submissionLimit?: number | null } export type EditFormFieldResult = Result