All checks were successful
Docker Image CI / build (push) Successful in 8m8s
33 lines
757 B
Plaintext
33 lines
757 B
Plaintext
@using Groceries.Data
|
|
|
|
@layout Layout
|
|
|
|
@inject IHttpContextAccessor HttpContextAccessor
|
|
|
|
<PageTitle>Groceries – Edit Store</PageTitle>
|
|
|
|
<h1>Edit Store</h1>
|
|
|
|
<StoreForm Store="Store">
|
|
<div class="row">
|
|
<button class="button button--primary">Save</button>
|
|
<a class="button" href="@returnUrl">Cancel</a>
|
|
</div>
|
|
</StoreForm>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public required Store Store { get; set; }
|
|
|
|
private string returnUrl = "/stores?page=1";
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
var request = HttpContextAccessor.HttpContext!.Request;
|
|
if (request.GetReferrerIfSameOrigin() is Uri referrer && referrer != request.GetUri())
|
|
{
|
|
returnUrl = referrer.PathAndQuery;
|
|
}
|
|
}
|
|
}
|