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

Fixes #13: Add validation handler to 3 post requests #30

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

haianhng31
Copy link
Member

@haianhng31 haianhng31 commented Oct 2, 2024

Resolves #13

  • Create a function validate_fields:

    • Inputs: required_fields, request_data
    • Output: boolean, error_message
  • In each of the post requests:

    • Check whether it has all the required fields using the function above
    • If it is, then add that new request into data object
    • Return the json object back to frontend accordingly
  • Add 6 test cases for 3 post requests:

    • One test case for successful creation of a new entry
    • One test case for unsuccessful creation because of missing fields

@haianhng31 haianhng31 changed the title Issue 13: Add validation handler to 3 post requests Fixes #13: Add validation handler to 3 post requests Oct 2, 2024
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.

Add validation that POST requests are in the correct format
1 participant