This commit is contained in:
mmrbnjd
2025-07-31 19:05:58 +03:30
parent 38031b2e81
commit 23c4bc2800
3 changed files with 112 additions and 64 deletions

View File

@@ -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;