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

[core] return error message on invalid dob (rebase 24.1) #8279

Merged

Conversation

regisoc
Copy link
Contributor

@regisoc regisoc commented Dec 16, 2022

Brief summary of changes

(Rebase of #8267 for 24.1)

When using /api/v0.0.3/candidates with an invalid date format, returns 400 Bad Requests/JSON errors.
This PR checks the date of birth and returns the correct format in the message ('yyyy-mm-dd').

Testing instructions (if applicable)

  1. Log into to get a token:
curl -v -k -X 'POST' \
  'https://<hostname>/api/v0.0.3/login' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "username": "<username>",
  "password": "<password>"
}'
  1. Test for /api/v0.0.3/candidates endpoint:
curl -v -k -X POST 'https://<hostname>/api/v0.0.3/candidates' \
    -H "Authorization: Bearer <token>" \
    -d '{
        "Candidate": {
            "Project": "Rye",
            "Site": "Montreal",
            "DoB": "<a_date>",
            "Sex": "Female"
        }
    }'

Link(s) to related issue(s)

@regisoc regisoc changed the title [core] return error message on invalid dob (duplicate 24.1) [core] return error message on invalid dob (rebase 24.1) Dec 18, 2022
@driusan driusan merged commit 77ceacb into aces:24.1-release Dec 20, 2022
@ridz1208 ridz1208 added this to the 24.1.2 milestone Feb 1, 2023
zaliqarosli pushed a commit to zaliqarosli/Loris that referenced this pull request Mar 6, 2023
When using /api/v0.0.3/candidates with an invalid date format, returns 400 Bad Requests/JSON errors.
This  checks the date of birth and returns the correct format in the message ('yyyy-mm-dd') and returns an appropriate error message if the check fails.
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.

None yet

4 participants