diff --git a/.gitignore b/.gitignore index 13017826..6ff1595a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules/ venv # api/prycey.db api/__pycache__ -# api/.env \ No newline at end of file +api/.env \ No newline at end of file diff --git a/api/main.py b/api/main.py index a5b01988..a9fa8c6f 100644 --- a/api/main.py +++ b/api/main.py @@ -470,6 +470,7 @@ def rate(uid): print(request.form.get('review')) nr = int(request.form.get('rating')) review = request.form.get('review') + print(uid) if "user_id" in sess: if 1 <= nr <= 5: diff --git a/api/prycey.db b/api/prycey.db index 6258cfec..60514642 100644 Binary files a/api/prycey.db and b/api/prycey.db differ diff --git a/src/components/PostOrder/PostOrder.jsx b/src/components/PostOrder/PostOrder.jsx index 73606b38..2caf32cf 100644 --- a/src/components/PostOrder/PostOrder.jsx +++ b/src/components/PostOrder/PostOrder.jsx @@ -13,24 +13,26 @@ import StarRating from '../StarRating/StarRating'; function PostOrder(props) { const {register, handleSubmit} = useForm(); const [rating, setRating] = useState(null); + const params = new URLSearchParams(props.location.search); + const id = params.get('id'); + const seller = params.get('seller') console.log(props) useEffect(() => { - const params = new URLSearchParams(props.location.search); - const id = params.get('id'); - const seller = params.get('seller') + + console.log(seller) }, []) const onSubmit = (value) =>{ - console.log(value, rating) + console.log(value) let fd = new FormData(); fd.append('review', value.review); fd.append('rating', rating); - axios.post(`http://127.0.0.1:5000/rating/${props.match.params.value}`, fd) - .then(response => toast(response.data.response, {position: toast.POSITION.TOP_CENTER})) - .catch(error => console.log(error)) + // axios.post(`http://127.0.0.1:5000/rating/${props.match.params}`, fd) + // .then(response => toast(response.data.response, {position: toast.POSITION.TOP_CENTER})) + // .catch(error => console.log(error)) } return (
{values.description}
-{values.category}
-years : {values.year}
-{values.dateAdded}
+{values.category}
+{values.year} yrs
+Posted on :
+{values.dateAdded}
+@@ -161,8 +174,11 @@ function ProductPage({match}) {
E-mail : {values.email}
Contact : +91 {values.contact}
- -Purchase
+