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

eShopLite: Don't checkout if there's no user basket #51

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

DamianEdwards
Copy link
Member

@DamianEdwards DamianEdwards commented Nov 29, 2023

Tweak to not attempt to call the checkout basket service if the call to get the basket returned null (meaning there's no current user basket).

I'll manually port this to the version of eShopLite in the main repo too.

Fixes #36

if (customerBasket is not null)
{
await BasketClient.CheckoutBasketAsync("user");
}

// Preserve query string
Navigation.NavigateTo($"/{new Uri(Navigation.Uri).Query}");
Copy link
Member

Choose a reason for hiding this comment

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

Should the NavigateTo only be called if there is a customer basket as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

We're still in a POST request so we need to perform the redirect (post-redirect-get).

@DamianEdwards DamianEdwards merged commit f304100 into main Nov 29, 2023
3 checks passed
@DamianEdwards DamianEdwards deleted the damianedwards/eshop-basket-error-fix branch November 29, 2023 15:50
meneasysoft pushed a commit to meneasysoft/aspire-samples that referenced this pull request Jul 25, 2024
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

Successfully merging this pull request may close these issues.

[eShopLite] Exception when navigating to cart
2 participants