diff --git a/src/helpers/PostProducts.js b/src/helpers/PostProducts.js index 43abfdd..7348d3e 100644 --- a/src/helpers/PostProducts.js +++ b/src/helpers/PostProducts.js @@ -11,6 +11,27 @@ const PostProducts = () => { const [type, setType] = useState("") const [unit, setUnit] = useState("") + const handleChange = (e) => { + if(e.target.name == 'name'){ + setName(e.target.value); + }else if(e.target.name == 'description'){ + setDescription(e.target.value); + }else if(e.target.name == 'category'){ + setCategory(e.target.value); + }else if(e.target.name == 'subcategory'){ + setSubcategory(e.target.value); + }else if(e.target.name == 'price'){ + setPrice(e.target.value); + }else if(e.target.name == 'type'){ + setType(e.target.value); + }else if(e.target.name == 'unit'){ + setUnit(e.target.value); + }else{ + //pass + } + } + + // TODO : add @post logic return ( <>