common-hosted-form-service icon indicating copy to clipboard operation
common-hosted-form-service copied to clipboard

Generate Proxy Headers lookup form/version Id when provided submissionId

Open usingtechnology opened this issue 1 year ago • 0 comments

Description

Error when submitting from a draft on a form that has an External API - seeing 400 errors.

The issue is loading that page has no form id context, thus the form id is not passed into the generate proxy headers function. When parsing the generated proxy headers (to resolve which external api to call) the external api cannot be found because there is no form id!

The fix is: when provided a submissionId, go find the form and version id and use those values in the generated proxy headers.

Types of changes

fix (a bug fix)

Checklist

  • [x] I have read the CONTRIBUTING doc
  • [x] I have checked that unit tests pass locally with my changes
  • [x] I have run the npm script lint on the frontend and backend
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] I have added necessary documentation (if appropriate)
  • [x] I have approval from the product owner for the contribution in this pull request

Further comments

JIRA: https://bcdevex.atlassian.net/browse/FORMS-1445?atlOrigin=eyJpIjoiYWE5ODM2NTE3MjNjNGY0NzgzMmI0NzAwZjA5ZmQxYzIiLCJwIjoiaiJ9

Fider: https://chefs-fider.apps.silver.devops.gov.bc.ca/posts/177/external-api-not-working-in-drafts

CCP Pages wiki: https://bcdevex.atlassian.net/wiki/spaces/CCP/pages/1553924326/External+API+does+not+work+in+Drafts

usingtechnology avatar Aug 15 '24 22:08 usingtechnology