NASA-PDS / doi-ui

The web interface for the PDS DOI Service providing the ability management PDS archive DOIs. See the DOI Service for more details on the available capabilities. https://nasa-pds.github.io/doi-service/
Apache License 2.0
0 stars 4 forks source link

typo in a request parameter when submitting doi #124

Closed tloubrieu-jpl closed 2 years ago

tloubrieu-jpl commented 2 years ago

๐Ÿ› Describe the bug

When we submit an updated DOI in the release form, there is a typo in the API request parameter identifier. identifer is used instead.

๐Ÿ“œ To Reproduce

Steps to reproduce the behavior:

  1. open the developer console in chrome
  2. Select a draft DOI in the search screen
  3. Click on the release button
  4. Click on submit for review, check the ignore warning checkbox if necessary
  5. The message says the submission is successful
  6. But in the developer console, the url sent to the api is in error http://localhost:8080/PDS_APIs/pds_doi_api/0.2/doi/submit?identifer=urn:nasa:pds:insight_cameras::5.0&force=true

๐Ÿ•ต๏ธ Expected behavior

๐Ÿ“š Version of Software Used

Latest version of the UI on main branch, with latest version of the API (deployed on pds-dev3)

๐Ÿฉบ Test Data / Additional context

๐ŸžScreenshots

๐Ÿ–ฅ System Info


๐Ÿฆ„ Related requirements

โš™๏ธ Engineering Details

eddiesarevalo commented 2 years ago

@tloubrieu-jpl for the first item "There should not be a success message, I am guessing only the error coming from the dois POST request are catch, we should catch error coming from the submit action as well."

For reserve there is a format for errors:

{
  "errors": [
    {
      "message": "There is already a DOI 10.13143/wj8z-df73 associated with PDS identifier urn:nasa:pds:insight_cameras::11.0 (status=review).\nYou cannot modify a DOI for an existing PDS identifier.",
      "name": "CriticalDOIException"
    }
  ]
}

For submit review there is no mention of error except for the status 400.

{
  "detail": "Missing query parameter 'identifier'",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

Since it doesn't come as an error array it is not detect as an error. The only way to know would be to check the status number. Should I make it check for different status numbers or can you return an errors array as when reserving?

tloubrieu-jpl commented 2 years ago

@eddiesarevalo you are right, we don't need to develop something for this type of errors since it will not happen once the identifier parameter will not have the typo.

Lets forget about capturing the submit errors for now.