Commit d44bc804 authored by Khai Yuan ​Liew's avatar Khai Yuan ​Liew

[AFP-12] Fix issue with search on searchResults page

parent 565f3c48
......@@ -19,7 +19,7 @@ export default function ProductGrid({ productData }) {
useEffect(() => fetchProducts(), []);
return (
<div class="container flex-column d-flex justify-content-center">
<div className="container flex-column d-flex justify-content-center">
<div className="container mt-3 d-flex justify-content-between align-items-center">
<h1 id="title" className="text-center">
Inventory
......
......@@ -34,6 +34,11 @@ class Search extends React.Component {
this.setState({results: res});
})
.catch(err => console.log(err));
if(this.props.location.pathname === "/searchResults"){
this.props.history.push("/products", this.state);
}
this.props.history.push("/searchResults", this.state);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment