...
This commit is contained in:
@@ -60,16 +60,10 @@ namespace HushianWebApp.Service
|
||||
var response = await _baseController.Post($"v1/Auth/AuthenticationFromUser",model);
|
||||
if (response.IsSuccessStatusCode)
|
||||
return await response.Content.ReadFromJsonAsync<int>();
|
||||
else if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
|
||||
{
|
||||
var Errors = await response.Content.ReadFromJsonAsync<List<string>>();
|
||||
_ToastService.Notify(new ToastMessage(ToastType.Danger, Errors[0].Split(':').Length == 2 ? Errors[0].Split(':')[1] : Errors[0]));
|
||||
|
||||
}
|
||||
else if (!response.IsSuccessStatusCode)
|
||||
else
|
||||
{
|
||||
|
||||
_NavigationManager.NavigateTo("Unhandled");
|
||||
_ToastService.Notify(new ToastMessage(ToastType.Danger, "کاربر یافت نشد"));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user