Created
July 1, 2020 13:16
-
-
Save jonhilt/7709894fe114dfd6db64a0fcd2956fcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected async Task HandleValidSubmit() | |
{ | |
var response = await Http.PostAsJsonAsync("api/post", Command); | |
if (response.StatusCode == HttpStatusCode.BadRequest) | |
{ | |
var result = await response.Content.ReadFromJsonAsync<CommandResult>(); | |
CustomValidator?.DisplayErrors(result.Errors); | |
} | |
else | |
{ | |
NavigationManager.NavigateTo($"/{Command.Slug}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment