@@ -36,7 +36,7 @@ interface ServiceFormState {
3636
3737type ServiceFormAction =
3838 | { type : 'SET_CURRENT_PAGE' ; payload : number }
39- | { type : 'SET_FIELD' ; payload : { field : string ; value : any } }
39+ | { type : 'SET_FIELD' ; payload : { field : string ; value : unknown } }
4040 | { type : 'SET_ERROR' ; payload : { field : string ; value : string } }
4141 | { type : 'CLEAR_ALL_ERRORS' }
4242 | { type : 'NEXT_PAGE' }
@@ -139,7 +139,7 @@ function serviceFormReducer(state: ServiceFormState, action: ServiceFormAction):
139139 }
140140}
141141
142- export function useServiceForm ( onCreateServiceCallback ?: ( ) => void | null ) {
142+ export function useServiceForm ( ) {
143143 const [ state , dispatch ] = useReducer ( serviceFormReducer , initialState ) ;
144144 const [ blueprintFormat , setBlueprintFormat ] = useState < BlueprintFormat > ( 'yaml' ) ;
145145
@@ -311,7 +311,7 @@ export function useServiceForm(onCreateServiceCallback?: () => void | null) {
311311 dispatch ( { type : 'SKIP_TO_CONFIRMATION' } ) ;
312312 } ;
313313
314- const setField = ( field : string , value : any ) => {
314+ const setField = ( field : string , value : unknown ) => {
315315 dispatch ( { type : 'SET_FIELD' , payload : { field, value } } ) ;
316316 } ;
317317
@@ -388,7 +388,9 @@ export function useServiceForm(onCreateServiceCallback?: () => void | null) {
388388 try {
389389 if ( ! currentBlueprint ) return ;
390390 await navigator . clipboard . writeText ( blueprintFormat === 'yaml' ? yamlConfig : jsonConfig ) ;
391- } catch ( err ) { }
391+ } catch ( error ) {
392+ console . error ( ( error as Error ) . message || "An unknown error occoured while retrieving blueprints" )
393+ }
392394 } ;
393395
394396 return {
0 commit comments