Skip to content
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

Merged
merged 5 commits into from
May 16, 2024
Merged

Conversation

Hemu21
Copy link
Contributor

@Hemu21 Hemu21 commented May 16, 2024

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 apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (Documentation content changed)
  • Other (please describe):

Checklist

Put an x in the boxes that apply

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • My changes does not break the current system and it passes all the current test cases.

@auto-assign auto-assign bot requested a review from jackfrost13 May 16, 2024 15:52
@@ -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

This route handler performs
a database access
, but is not rate-limited.
@Hemu21
Copy link
Contributor Author

Hemu21 commented May 16, 2024

@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;
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above

@Hemu21
Copy link
Contributor Author

Hemu21 commented May 16, 2024

@Kajol-Kumari updated can you please check

@Kajol-Kumari Kajol-Kumari added level1 Wiki or Major Documentation work. gssoc GSSoC'24 Label labels May 16, 2024
@Kajol-Kumari Kajol-Kumari merged commit 330d647 into HITK-TECH-Community:main May 16, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc GSSoC'24 Label level1 Wiki or Major Documentation work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend Get q&A using ID
2 participants