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

CreateListing offer error #19

Open
reidbuchanan opened this issue Dec 23, 2022 · 1 comment
Open

CreateListing offer error #19

reidbuchanan opened this issue Dec 23, 2022 · 1 comment

Comments

@reidbuchanan
Copy link

Does anyone else when testing run into an error where for some reason certain entries for Regular Price and Discounted Price can trigger the error catch from toast even if logically it is sound? For example:
Regular Price: 10000 and Discounted Price 8000 has been giving me issues.
Then, once the error is triggered, even if you remove the offer section, no matter what value you put in for regular price will trigger that same error message.
I hope this makes sense.

@reidbuchanan
Copy link
Author

ok fixed that by adding the Number() function to each price in the comparison operator

if (Number(discountedPrice) >= Number(regularPrice)) {
        setLoading(false)
        toast.error('Discounted price needs to be less than regular price')
        return
    }

However I still can't figure out why the toast error message will continue to pop up if you don't refresh the page after submitting a discounted price > regular price and then going through and fixing it. Any ideas?

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

1 participant