From c164adf047d8b0f560f5db43c0eb625907557973 Mon Sep 17 00:00:00 2001 From: Umer Date: Thu, 16 Nov 2023 13:19:55 +0200 Subject: [PATCH] refactoring --- ui/src/routes/incarnations/EditForm.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/ui/src/routes/incarnations/EditForm.tsx b/ui/src/routes/incarnations/EditForm.tsx index 9ee800b7..7a62fa35 100644 --- a/ui/src/routes/incarnations/EditForm.tsx +++ b/ui/src/routes/incarnations/EditForm.tsx @@ -9,17 +9,14 @@ import { IncarnationsForm } from './Form' import { Section } from './parts' import { Incarnation } from '../../interfaces/incarnations.types' -const toIncarnationInput = (x: Incarnation): IncarnationInput => { - const templateData = JSON.stringify(x.templateData, null, 2) - return { - automerge: true, - repository: x.incarnationRepository, - targetDirectory: x.targetDirectory, - templateRepository: x.templateRepository ?? '', - templateVersion: x.templateRepositoryVersion ?? '', - templateData - } -} +const toIncarnationInput = (x: Incarnation): IncarnationInput => ({ + automerge: true, + repository: x.incarnationRepository, + targetDirectory: x.targetDirectory, + templateRepository: x.templateRepository ?? '', + templateVersion: x.templateRepositoryVersion ?? '', + templateData: JSON.stringify(x.templateData, null, 2) +}) export const EditIncarnationForm = () => { const { id } = useParams()