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

Update eShopLite to not call basket checkout if no current basket #1087

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).

Port of dotnet/aspire-samples#51

This started happening when #361 was merged I think.

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 redirect (post-redirect-get).

@DamianEdwards DamianEdwards merged commit a8ac29a into main Nov 29, 2023
3 checks passed
@DamianEdwards DamianEdwards deleted the damianedwards/eshoplite-fix branch November 29, 2023 15:51
@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants