preg_match('/^[a-z]{1,}_[a-z]{1,}$/iu', $input_line, $output_array);
import { FETCH_PRODUCTS_SUCCESS } from '../constants/catalog';
const initialState = {
item: [],
select_sect_code: [],
append: false,
}
export default function ProductsReducer(state = initialState, action) {
switch (action.type) {
case FETCH_PRODUCTS_SUCCESS:
return {
item: action.products,
select_sect_code: action.select_sect_code,
append: action.append
}
default:
return state;
}
}
export const fetchProducts = (products, select_sect_code, append) => {
return {
type: FETCH_PRODUCTS_SUCCESS,
products,
select_sect_code,
append
}
};
export const fetchAllProducts = (url, code, append) => {
return (dispatch) => {
return axios
.post(url, {products: code})
.then(response => {
dispatch(fetchProducts(response.data, code, append))
})
.catch(error => console.error(error));
};
};
constructor() {
super();
this.state = {
product_data: []
}
}
Testovik = (val) => {
console.log("val");
}
// Далее в рендере
<CollapseFilterCatalog Testovik={this.Testovik} />
this.props.Testovik("Прием")