const updateContent = (values: any) => {
brands.map((brand: any) => {
if (brand.brandName === values.brand) {
values.brand = brand.id;
}
})
dispatch(updateProduct(currentProduct.id, values))
.then(response => {
props.history.push("/products");
})
.catch(e => {
console.log(e);
});
};
I use it in js then ok but use it in typescript then got this error. How to use dispatch().then() in typescript. Please show me. Thanks!!!
