Skip to content

Conversation

@ndg63276
Copy link
Collaborator

JIRA ticket: LIMS-2040

Summary:

Creating a puck, and then creating another, gives an internal server error. This was introduced by #965, as parentContainerId and parentContainerLocation are reset to empty strings between pucks, rather than nulls. The backend also doesn't sanitise the input, so the database throws an error.

Changes:

  • Fix the frontend - so parentContainerId and Location are reset to nulls between pucks
  • Fix the backend - coerce empty fields to nulls for those 2 fields
  • Add more to the error message to help debugging in future
  • NB one way to fix the error would be to define parentContainerId/Location as \d+ rather than \d*. But they need to be \d* for the case where you are deleting the parentContainer.

To test:

  • Go to any proposal, any shipment (new or existing)
  • Create a puck with at least one sample
  • Create a second puck (without refreshing the page or clicking back or anything), check no errors occur. The payload sent should have parentContainerId as null, not "".
  • Remove the frontend fix. repeat the test, check the backend fixes work :)

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.

2 participants