Is there a method in Angular that allows conversion of a JSON payload object into FormData? Here is an example code snippet:
#Payload Output
{
"id": 0,
"name": null,
"dealType": "Partner Location Submission",
"annualRentProposed": null,
"annualRentCurrent": null,
"firmTermRemaining": null,
"firmTermAdded": null,
"maxAvailableTerm": null,
"status": null,
"capitalContribution": null,
"parentCloneId": null,
"accountId": 4,
"transactionId": 173,
"dealTypeValues": "{"id":0,"summary":"13123","mlasId":2,"startDate":"2021-10-27","endDate":"2021-10-27","rent":"2321","cam":"312","securityMonitoringMonthly":"12312","supportServicesFee":"312","estimatedOtherRevenue":"12312","descriptionOfOtherRevenue":"3123123","totalMonthlyRentAndFees":15380,"buildOutCostReimbursement":"123123","dealId":0,"startDateString":"2021-10-27","endDateString":"2021-10-27"}",
"isReadyForApproval": false
}
#Payload Code
const payload = {
"id": 0,
"name": this.dealPLSFormFields.dealName,
"dealType": "Partner Location Submission",
"annualRentProposed": null,
"annualRentCurrent": null,
"firmTermRemaining": null,
"firmTermAdded": null,
"maxAvailableTerm": null,
"status": null,
"capitalContribution": null,
"parentCloneId": null,
"accountId": this.currentAccount.accountId,
"transactionId": this.transactionData.id,
"dealTypeValues": JSON.stringify(dealTypeValues),
"isReadyForApproval": this.isReadyForApproval
}