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

created a proper get request and added queries #31

Merged
merged 3 commits into from
Oct 3, 2023
Merged

Conversation

kaamil2
Copy link
Contributor

@kaamil2 kaamil2 commented Sep 29, 2023

What was the ticket?

Link to Ticket:

in issue 10 i was told to retrieve quiz details for a specific submodule, so i had to create
GET endpoint that accepts a submodule ID in the request parameters and responds with submodule quiz details if the ID exists.

What did I do?

I created an exam.ts file which creates a GET endpoint that hs handler function in this file checks if the request is the proper endpoint. If it is not, it responds with an error showing wrong request method. otherwise the getSubModuleQuiz function is run this function extracts the ID from the query parameters and queries the database for the exam based on the ID.If the provided ID is not an integer, a 403 Response will be sent to the client with a message requesting them to provide an integer value.If the query is empty, a 404 Response will be sent, accompanied by a message indicating that the Module Exam was not found.In the event of a successful query that returns information, the retrieved information will be included in the HTTP Response.

How did I test it? Document test cases here.

I self tested with the images shown below :

Screenshot 2023-09-28 at 9 26 00 PM Screenshot 2023-09-28 at 9 25 20 PM Screenshot 2023-09-28 at 9 25 11 PM

What could go wrong in the future? What parts of your code should the reviewer pay the most attention to?

The main issue that could go wrong is if there is a decimal it will jsut be brought to the number before the decimal... and the id is not a string return it is a number return

Additional comments for the reviewers

Screenshots

@kaamil2 kaamil2 linked an issue Sep 29, 2023 that may be closed by this pull request
@TylerSchaefer4 TylerSchaefer4 merged commit 12781e5 into main Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EDU-10 Get quiz
2 participants