import { IAction } from 'types' ; import { fetchBetaRecommendedColumns , fetchRecommendedColumns } from 'services/recommendedColumns/actions' ; export const addInputColumn = ( fhirAttribute , inputColumn ) => { return { type : 'ADD_INPUT_COLUMN_MIMIC' , payload : { fhirAttribute , inputColumn } } ; } ; export const changeTypeMimic = ( fhirAttribute , type , head_table , mot_clef ) : IAction => { return ( dispatch , getState ) => { Promise . all ( [ dispatch ( fetchBetaRecommendedColumns ( fhirAttribute , type , head_table , mot_clef ) ) ] ) . then ( ( response ) => { dispatch ( updateTypeMimic ( fhirAttribute , type ) ) ; } ) ; } ; } ; export const updateTypeMimic = ( fhirAttribute , type ) : IAction => { return { type : 'UPDATE_TYPE_MIMIC' , payload : { fhirAttribute , type } } ; } ; export const changeMotClefMimic = ( fhirAttribute , type , head_table , mot_clef ) : IAction => { return ( dispatch , getState ) => { Promise . all ( [ dispatch ( fetchBetaRecommendedColumns ( fhirAttribute , type , head_table , mot_clef ) ) ] ) . then ( ( response ) => { dispatch ( updateMotClefMimic ( fhirAttribute , mot_clef ) ) ; } ) ; } ; } ; export const updateMotClefMimic = ( fhirAttribute , mot_clef ) : IAction => { return { type : 'UPDATE_MOT_CLEF_MIMIC' , payload : { fhirAttribute , mot_clef } } ; } ;