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

[API] PUT a new visit for a candidate fails #7087

Closed
spell00 opened this issue Oct 7, 2020 · 1 comment
Closed

[API] PUT a new visit for a candidate fails #7087

spell00 opened this issue Oct 7, 2020 · 1 comment
Labels
API PR or issue introducing/requiring modifications to the API code Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label)

Comments

@spell00
Copy link
Contributor

spell00 commented Oct 7, 2020

Describe the bug
New visits can't be added using PUT requests to the endpoint /candidates/{candidate}/{visit} using the correct request. It works with an incorrect request (see Additional context below for details).

To Reproduce
Steps to reproduce the behavior:

1- Login using a POST request to the \login:

curl https://<your-hostname>/api/v0.0.3/login -d '{"username": "<your-username>", "password": "<your-password>"}'

2- Store the token in a variable.

~$ token='<a-really-long-string>'

3- The following command should work, but doesn't:

curl -X PUT -H "Authorization: Bearer $token" https://test-loris-dev.loris.ca/api/v0.0.3/candidates/115788/V1 -d '{"CandID":"115788","Visit":"V1","Site":"Rome","Battery":"Stale","Project":"Rye"}' returns an error.

What did you expect to happen?
The PUT request should return nothing. Go to https://<your-hostname>/api/v0.0.3/candidates/115788/, the visit V1 should be present, but is not.

Additional context
curl -X PUT -H "Authorization: Bearer $token" https://test-loris-dev.loris.ca/api/v0.0.3/candidates/115788/V3 -d '{"CandID":"115788","Visit":"V1","Site":"Rome","Battery":"Stale","Project":"Rye"}' should fail, because the visit in the url should be V1. However, the PUT request works this way and V1 is added successfully

@spell00 spell00 added Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) API PR or issue introducing/requiring modifications to the API code labels Oct 7, 2020
@driusan
Copy link
Collaborator

driusan commented Nov 21, 2023

Fixed by linked PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API PR or issue introducing/requiring modifications to the API code Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label)
Projects
None yet
Development

No branches or pull requests

3 participants