diff --git a/src/features/environmentCreate/components/Specification/SpecificationCreate.tsx b/src/features/environmentCreate/components/Specification/SpecificationCreate.tsx index 02c2ffd5..d7b14a24 100644 --- a/src/features/environmentCreate/components/Specification/SpecificationCreate.tsx +++ b/src/features/environmentCreate/components/Specification/SpecificationCreate.tsx @@ -81,6 +81,21 @@ export const SpecificationCreate = ({ onCreateEnvironment }: any) => { setShow(value); }; + const formatCode = ( + channels: string[], + dependencies: string[], + variables: Record + ) => { + if ( + channels.length === 0 && + dependencies.length === 0 && + Object.keys(variables).length === 0 + ) { + return "channels:\n -\ndependencies:\n -\nvariables: {}"; + } + return stringify({ channels, dependencies, variables }); + }; + const handleSubmit = () => { const code = show ? editorContent @@ -104,7 +119,7 @@ export const SpecificationCreate = ({ onCreateEnvironment }: any) => { {show ? ( ) : (