diff --git a/frontend/src/pages/Q&A/Q&A.jsx b/frontend/src/pages/Q&A/Q&A.jsx index 8a4262f8..686f1522 100644 --- a/frontend/src/pages/Q&A/Q&A.jsx +++ b/frontend/src/pages/Q&A/Q&A.jsx @@ -5,7 +5,12 @@ import "./Ques.scss"; import Joi from "joi-browser"; import Loader from "../../components/util/Loader/index"; import { SimpleToast } from "../../components/util/Toast"; -import { getAllQuestion, uploadData, upvote, downvote } from "../../service/Faq"; +import { + getAllQuestion, + uploadData, + upvote, + downvote, +} from "../../service/Faq"; import { showToast, hideToast } from "../../service/toastService"; function Ques(props) { @@ -109,6 +114,7 @@ function Ques(props) { }); setFormErrors({}); setCheckedState(new Array(Tags.length).fill(false)); + setButtonPressed(false); }) .catch(() => { setIsUploadingData(false); @@ -129,7 +135,7 @@ function Ques(props) { await upvote(questionId, setToast); fetchQuestions(); }; - + const handleDownvote = async (questionId) => { await downvote(questionId, setToast); fetchQuestions(); @@ -164,7 +170,10 @@ function Ques(props) {

Created At {new Date(item.createdAt).toLocaleString()}

-

-
+
{formerrors["title"] ? (
* {formerrors["title"]}
) : ( @@ -254,8 +268,13 @@ function Ques(props) { value={formdata.description} onChange={handleChange} /> - -
+ +
{formerrors["body"] ? (
* {formerrors["body"]}
) : ( @@ -322,7 +341,10 @@ function Ques(props) {
-
+
{isUploadingData ? (