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

Order extra field isRequired property being parsed as truthy #161

Open
1 of 2 tasks
jp06 opened this issue Nov 14, 2024 · 2 comments
Open
1 of 2 tasks

Order extra field isRequired property being parsed as truthy #161

jp06 opened this issue Nov 14, 2024 · 2 comments
Labels

Comments

@jp06
Copy link

jp06 commented Nov 14, 2024

Type: (Select one)

  • Bug Report
  • Feature Request

Summary:

I'm not sure about the buyer portal react app but this affects checkout. We cannot currently proceed in the default B2B checkout due to all extra fields being required. The isRequired field when false is actually a string 0 which causes a problem as it's a truthy value. I had to add logic to parse this string in a B2B checkout fork to mitigate this.

Even B2B Edition app is affected:
image

Expected Behavior:

Expecting isRequired to be a falsey value when false. It's not bool false, or even just number 0, but a string 0.

Actual Behavior:

isRequired value when false is a string 0 which is truthy.

Backend Request Information:

GET https://api.bundleb2b.net/api/v2/extra-fields/order/storefront
@bc-victor
Copy link
Contributor

Hi @jp06 in which component do you see this condition conflicting the rendering?

@jp06
Copy link
Author

jp06 commented Nov 19, 2024

Hi @bc-victor, I hope this helps but I put something like this in packages/core/src/app/b3checkout/extrasFiles/utils.ts of the checkout fork we have to handle this for now:
image

Or if you are referring to Buyer Portal react app, I'm not aware of issues caused by this yet.

@bc-victor bc-victor removed the on hold label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants