File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,13 +78,29 @@ export const SortableStepItem: React.FC<SortableStepItemProps> = ({
7878 const handleTemplateSelect = ( templateId : string ) => {
7979 const template = httpTemplates . find ( t => t . id === templateId ) ;
8080 if ( template ) {
81+ // Seed default mappings so execution can rely on explicit entries
82+ const pathParams = extractPathParams ( template . pathTemplate ) ;
83+ const queryParams = extractQueryParams ( template . queryTemplate ) ;
84+
85+ const defaultParamMappings = pathParams . reduce < Record < string , { type : 'auto' | 'fixed' | 'skip' ; value ?: string } > > ( ( acc , param ) => {
86+ acc [ param ] = step . params ?. paramMappings ?. [ param ] ?? { type : 'auto' } ;
87+ return acc ;
88+ } , { } ) ;
89+
90+ const defaultQueryMappings = queryParams . reduce < Record < string , { type : 'auto' | 'fixed' | 'skip' ; value ?: string } > > ( ( acc , param ) => {
91+ acc [ param ] = step . params ?. queryMappings ?. [ param ] ?? { type : 'auto' } ;
92+ return acc ;
93+ } , { } ) ;
94+
8195 onUpdateStep ( step . id , {
8296 params : {
8397 ...step . params ,
8498 httpTemplateId : templateId ,
8599 baseUrl : template . baseUrl ,
86100 pathTemplate : template . pathTemplate ,
87101 queryTemplate : template . queryTemplate ,
102+ paramMappings : defaultParamMappings ,
103+ queryMappings : defaultQueryMappings ,
88104 // 출력 타입 초기화
89105 outputType : step . params ?. outputType || 'full' ,
90106 }
You can’t perform that action at this time.
0 commit comments