HackYourFuture-CPH / Guide-IT

Guide IT, a tool to help newcomers decide their IT path
MIT License
3 stars 1 forks source link

GET api route for all questions and questions by id #113

Closed cph-kiwi closed 3 years ago

cph-kiwi commented 3 years ago

Description

We want to be able to get questions with specific criteria so that we can show those questions. I created a GET request for all the questions and to retrieve a question by id. I'd like to add more specific criteria about searching for questions created before or after a certain date, and for searching for questions with specific words in. However, the issue instructed to break the PR's up a bit so that they aren't huge. I can add more once this has been approved.

Fixes # https://github.com/HackYourFuture-CPH/Guide-IT/issues/29

How to test?

Once you have run the migration and seeding to your local database, open this branch and run npm run dev. Go to localhost:3000/api/documentation. You will see two GET requests for questions. You can run the tests from there, to retrieve all the questions and a question by its id.

Checklist

cph-kiwi commented 3 years ago

The typescript camelcase plugin does not seem to be supported in the current version of eslint. So I removed the problematic line from the config.

Poorooshka commented 3 years ago

Hi Beth, it's best to keep the PR name as simple as possible. So I this it's better to remove the word "created"

cph-kiwi commented 3 years ago

@bytewiz I made changes as a result of your suggestions. I pulled from develop branch before pushing, and then had to bug fix before I could commit changes, so a couple of extra files there now. But it's ready to approve.