diff --git a/src/index.js b/src/index.js index 05329e4..dc6683f 100644 --- a/src/index.js +++ b/src/index.js @@ -12,7 +12,7 @@ import axios from 'axios' const setupAxios = () => { axios.defaults.baseURL = 'https://cms-api-dashboard.herokuapp.com/'; - // axios.defaults.baseURL = 'http://localhost:5000' + //axios.defaults.baseURL = 'http://localhost:5000' axios.defaults.headers = { 'Cache-Control': 'no-cache,no-store', 'Pragma': 'no-cache', diff --git a/src/views/Category/AddCategory.js b/src/views/Category/AddCategory.js index 5ecb8d8..200a4bb 100644 --- a/src/views/Category/AddCategory.js +++ b/src/views/Category/AddCategory.js @@ -26,12 +26,13 @@ const AddProduct = () => { const token = isAutheticated(); let history = useHistory(); const [image, setImage] = useState(""); + const [ctegoryBannerImage, setCtegoryBannerImage] = useState(""); const [name, setName] = useState(""); const [loading, setLoading] = useState(false); const handleSubmit = async () => { - if (!(name && image)) { + if (!(name && image && ctegoryBannerImage)) { return swal('Error!', 'All fields are required', 'error') } @@ -41,6 +42,7 @@ const AddProduct = () => { myForm.set("image", image); + myForm.set("category_banner", ctegoryBannerImage); setLoading({ loading: true }); // console.log(image) try { @@ -103,8 +105,9 @@ const AddProduct = () => { value={name} placeholder="Name" /> +