Skip to content

Commit

Permalink
Merge 6f12693 into b0331b0
Browse files Browse the repository at this point in the history
  • Loading branch information
kathleenkhy committed Mar 27, 2024
2 parents b0331b0 + 6f12693 commit 62ce3e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shared/types/form/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export type AdminDashboardFormMetaDto = Pick<

export type DuplicateFormOverwriteDto = {
title: string
submissionLimit?: number | null
} & (
| {
responseMode: FormResponseMode.Email
Expand Down Expand Up @@ -347,7 +348,7 @@ export type CreateStorageFormBodyDto = Pick<
export type CreateMultirespondentFormBodyDto = Pick<
MultirespondentFormDto,
'publicKey' | 'responseMode' | 'title'
> & { workspaceId?: string }
> & { workspaceId?: string } & { submissionLimit?: number | null }

export type CreateFormBodyDto =
| CreateEmailFormBodyDto
Expand Down
6 changes: 6 additions & 0 deletions src/app/modules/form/admin-form/admin-form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,12 @@ export const duplicateForm = (

const duplicateParams = originalForm.getDuplicateParams(overrideProps)

// if MRF, set submissionLimit (i.e. response limit) = null

if (overrideParams.responseMode === FormResponseMode.Multirespondent) {
duplicateParams.submissionLimit = null
}

if (workspaceId)
return ResultAsync.fromPromise(
createFormInWorkspaceTransaction(duplicateParams, workspaceId),
Expand Down

0 comments on commit 62ce3e4

Please sign in to comment.