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

Fix null value of additional entity when no additional entities are uploaded #1919

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

Sujanadh
Copy link
Contributor

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Describe this PR

This PR fixes the parsing of null value of additional entities as a string in form-data when no additional entities are uploaded. It updates the body of generate-project-data by parsing null as a JSON instead of form data.

Screenshots

N/A

Alternative Approaches Considered

Did you attempt any other approaches that are not documented in code?

Review Guide

Notes for the reviewer. How to test this change?

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@Sujanadh Sujanadh self-assigned this Nov 26, 2024
@github-actions github-actions bot added bug Something isn't working frontend Related to frontend code labels Nov 26, 2024
Copy link
Member

@spwoodcock spwoodcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may need to be solved on the backend instead, where we check for null and do not process the additional entities if so

headers: {
'Content-Type': 'multipart/form-data',
'Content-Type': 'application/json',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done finding the problem!
It makes sense now πŸ˜„

But here I think form data was used to provide a file name, so that can give a name to the additional entity list.

Does this work correctly when using a json upload?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this works correctly. πŸŽ‰

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The form data was used because of custom xlsform upload, we don't need form data only for the additional_entities list.

@spwoodcock
Copy link
Member

But equally if this is working well, then we can keep this approach too! Just wanted to check

@spwoodcock spwoodcock merged commit 7cbbd3c into development Nov 28, 2024
5 of 6 checks passed
@spwoodcock spwoodcock deleted the fix/null-additional-entity branch November 28, 2024 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Related to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants