Skip to content

Commit 85b54d7

Browse files
committed
chore: restore past naming
1 parent 767d4e8 commit 85b54d7

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/app/modules/submission/email-submission/email-submission.util.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export const getAnswerForSignature = (
259259

260260
/**
261261
* Formats the response for sending to the submitter (autoReplyData),
262-
* the table that is sent to the admin (responseData),
262+
* the table that is sent to the admin (formData),
263263
* and the json used by data collation tool (dataCollationData).
264264
*
265265
* @param response
@@ -292,7 +292,7 @@ export const getFormattedResponse = (
292292
}
293293

294294
// Send all the fields to admin
295-
const responseData = {
295+
const formData = {
296296
question: getFormDataPrefixedQuestion(response, hashedFields),
297297
answerTemplate: answerSplitByNewLine,
298298
answer,
@@ -301,7 +301,7 @@ export const getFormattedResponse = (
301301
return {
302302
autoReplyData,
303303
dataCollationData,
304-
responseData,
304+
formData,
305305
}
306306
}
307307

@@ -462,16 +462,16 @@ export const mapRouteError: MapRouteError = (error) => {
462462

463463
/**
464464
* Concatenate response into a string for hashing
465-
* @param responsesData Field-value tuples for admin email
465+
* @param formData Field-value tuples for admin email
466466
* @param attachments Array of attachments as buffers
467467
* @returns concatenated response to hash
468468
*/
469469
export const concatAttachmentsAndResponses = (
470-
responsesData: EmailAdminDataField[],
470+
formData: EmailAdminDataField[],
471471
attachments: IAttachmentInfo[],
472472
): string => {
473473
let response = ''
474-
response += responsesData.reduce((acc, fieldResponseData) => {
474+
response += formData.reduce((acc, fieldResponseData) => {
475475
const question = fieldResponseData.question.toString().trim()
476476
const answer = fieldResponseData.answer.toString().trim()
477477
return acc + `${question} ${answer}; `
@@ -698,9 +698,9 @@ export class SubmissionEmailObj {
698698
: unmaskedAutoReplyData
699699
}
700700
/**
701-
* Getter function to return responsesData which is used to send responses to admin
701+
* Getter function to return formData which is used to send responses to admin
702702
*/
703-
get responsesData(): EmailAdminDataField[] {
703+
get formData(): EmailAdminDataField[] {
704704
return this.parsedResponses.flatMap((response) =>
705705
createFormattedDataForOneField(
706706
response,

src/app/modules/submission/encrypt-submission/encrypt-submission.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export const performEncryptPostSubmissionActions = ({
286286
})
287287
: []
288288

289-
const { responsesData, dataCollationData } = new SubmissionEmailObj(
289+
const { formData, dataCollationData } = new SubmissionEmailObj(
290290
emailFields,
291291
new Set(), // the MyInfo prefixes are already inserted in middleware
292292
form.authType,
@@ -314,7 +314,7 @@ export const performEncryptPostSubmissionActions = ({
314314
autoReplyMailDatas: recipientEmailDatas,
315315
submission,
316316
form,
317-
responsesData,
317+
responsesData: formData,
318318
})
319319

320320
return pdfAttachmentResult.andThen((pdfAttachment) => {
@@ -328,7 +328,7 @@ export const performEncryptPostSubmissionActions = ({
328328
id: submission.id,
329329
},
330330
submissionAttachments,
331-
formData: responsesData,
331+
formData,
332332
dataCollationData: formattedDataCollationData,
333333
pdfAttachment: checkIfAdminPdfIsRequired()
334334
? pdfAttachment
@@ -347,7 +347,7 @@ export const performEncryptPostSubmissionActions = ({
347347
submission,
348348
submissionAttachments,
349349
recipientData: recipientEmailDatas,
350-
responsesData,
350+
responsesData: formData,
351351
pdfAttachment: checkIfRespondentFormSummaryIsRequired({
352352
isPaymentEnabled,
353353
autoReplyMailDatas: recipientEmailDatas,

src/app/modules/submission/multirespondent-submission/__tests__/multirespondent-submission.utils.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ import {
4242

4343
import * as fieldValidation from '../../../../utils/field-validation'
4444
import { ValidateFieldErrorV3 } from '../../submission.errors'
45-
import { getQuestionAnswerPairsForMultipleFields } from '../../submission.utils'
4645
import {
4746
createMultirespondentSubmissionDto,
4847
createPublicMultirespondentSubmissionDto,
48+
getQuestionAnswerPairsForMultipleFields,
4949
retrieveWorkflowStepEmailAddresses,
5050
validateMrfFieldResponses,
5151
} from '../multirespondent-submission.utils'

src/types/email_mode_data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export type EmailDataFields =
2727
export interface EmailData {
2828
autoReplyData: EmailRespondentConfirmationField[]
2929
dataCollationData: EmailDataCollationToolField[]
30-
responsesData: EmailAdminDataField[]
30+
formData: EmailAdminDataField[]
3131
}
3232

3333
export interface EmailDataForOneField {
3434
autoReplyData?: EmailRespondentConfirmationField
3535
dataCollationData?: EmailDataCollationToolField
36-
responseData: EmailAdminDataField
36+
formData: EmailAdminDataField
3737
}
3838

3939
export interface IAttachmentInfo {

0 commit comments

Comments
 (0)