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

[Bug]: Incorrect type definition of discountId in updateCheckout #49

Open
gorshkovaea opened this issue Jun 13, 2024 · 1 comment
Open
Assignees

Comments

@gorshkovaea
Copy link

What happened?

I got an error "Type null is not assignable to type string | undefined" when I tried to call
paddle.Checkout.updateCheckout({ discountId: null, items: [{ priceId: 'newPriceId', quantity: 1 }], });.

I expect the type of discountId to be string | null, as docs state

Steps to reproduce

  1. Call paddle.Checkout.updateCheckout in .ts file with discountId: null
  2. Get a ts error "Type null is not assignable to type string | undefined"

What did you expect to happen?

paddle.Checkout.updateCheckout({ discountId: null, items: [{ priceId: 'newPriceId', quantity: 1 }], }); works well without any errors

How are you integrating?

React, TypeScript

Logs

No response

@vijayasingam-paddle vijayasingam-paddle self-assigned this Jun 13, 2024
@vijayasingam-paddle
Copy link
Contributor

Hi @gorshkovaea,
Thank you for reporting this issue to us.
I am sorry that you are running into this issue. We will check and update the types.

Thank you.

danbillson added a commit that referenced this issue Sep 30, 2024
This is should be allowed to remove the discount which was previously applied

Issue: #49
danbillson added a commit that referenced this issue Oct 1, 2024
* feat(types): add variant to checkout

* fix(types): allow null discount in update checkout

This is should be allowed to remove the discount which was previously applied

Issue: #49

* chore: create patch release

* docs: update changelog

* chore: update date of change

Co-authored-by: Vijayasingam Thanasekaran <100207323+vijayasingam-paddle@users.noreply.github.com>

---------

Co-authored-by: Vijayasingam Thanasekaran <100207323+vijayasingam-paddle@users.noreply.github.com>
danbillson added a commit that referenced this issue Oct 1, 2024
This is should be allowed to remove the discount which was previously applied

Issue: #49
danbillson added a commit that referenced this issue Oct 1, 2024
* feat(types): add variant to checkout

* fix(types): allow null discount in update checkout

This is should be allowed to remove the discount which was previously applied

Issue: #49

* chore: create patch release
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

No branches or pull requests

2 participants