const {id} = useParams();
const [category, setCategory] = useState([]);
const getCategory = async () => {
const params = {
id: id
};
const data = await API.getOne('category', params);
setCategory(data);
}
useEffect(() => {
getCategory();
}, [id]);