-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backend Get q&A using ID #906
Conversation
@@ -14,7 +14,7 @@ | |||
router.get('/getallquestions', getAllQuestion); | |||
|
|||
// This route will give question by given id | |||
router.get('/getQuestionById', getQuestionById); | |||
router.get('/getQuestionById/:questionId', getQuestionById); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
@Kajol-Kumari can you please check this |
@@ -5,7 +5,7 @@ const { ErrorHandler } = require('../../../../helpers/error'); | |||
const constants = require('../../../../constants'); | |||
|
|||
module.exports = async (req, res, next) => { | |||
const qId = req.body.question_id; | |||
const qId = req.params.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what id
it denotes? can you name it properly questionId
or answerId
@@ -12,7 +12,7 @@ const updateAnswerStatus = require('./updateAnswerStatus'); | |||
router.post('/', validation(answerValidationSchema), postAnswer); | |||
|
|||
// GET API FOR ANSWERS | |||
router.get('/', validation(getAnswerValidationSchema), getAnswers); | |||
router.get('/:id', validation(getAnswerValidationSchema), getAnswers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above
@Kajol-Kumari updated can you please check |
Issue that this pull request solves
Issue Link resolve #905
Closes: #905
Brief description of what is fixed or changed
I made the router to dynamic and get that data from params. backend is fixed.
Types of changes
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply