...
This commit is contained in:
@@ -142,16 +142,16 @@ namespace HushianWebApp.Service
|
||||
}
|
||||
else if (result.StatusCode == System.Net.HttpStatusCode.Forbidden)
|
||||
_ToastService.Notify(new ToastMessage(ToastType.Danger, "به این بخش دسترسی ندارید"));
|
||||
else if (result.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
{
|
||||
string From ="" ;
|
||||
//else if (result.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
//{
|
||||
// string From ="" ;
|
||||
|
||||
if (result.RequestMessage.RequestUri.AbsolutePath.ToString().Contains("GetCompany")) From = "شرکت";
|
||||
// if (result.RequestMessage.RequestUri.AbsolutePath.ToString().Contains("GetCompany")) From = "شرکت";
|
||||
|
||||
_ToastService.Notify(new ToastMessage(ToastType.Danger, $"{From} یافت نشد"));
|
||||
//_ToastService.Notify(new ToastMessage(ToastType.Danger, $"{From} یافت نشد"));
|
||||
|
||||
}
|
||||
else if (!result.IsSuccessStatusCode)
|
||||
//}
|
||||
else if (!result.IsSuccessStatusCode && (result.StatusCode != System.Net.HttpStatusCode.NotFound))
|
||||
{
|
||||
|
||||
_NavigationManager.NavigateTo("Unhandled");
|
||||
|
||||
@@ -113,11 +113,19 @@ namespace HushianWebApp.Service
|
||||
{
|
||||
var response = await _baseController.Get($"{BaseRoute}User/LastOpenChatInCompany/{CompanyID}");
|
||||
if (response.StatusCode==System.Net.HttpStatusCode.OK)
|
||||
return await response.Content.ReadFromJsonAsync<ChatItemDto>();
|
||||
return await response.Content.ReadFromJsonAsync<ChatItemDto?>();
|
||||
|
||||
return null;
|
||||
}
|
||||
public async Task<ChatItemDto?> Getchat(int ChatID)
|
||||
public async Task<(int,int)?> GetLastChat()
|
||||
{
|
||||
var response = await _baseController.Get($"{BaseRoute}User/LastChat");
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||
return await response.Content.ReadFromJsonAsync<(int, int)?>();
|
||||
|
||||
return null;
|
||||
}
|
||||
public async Task<ChatItemDto?> Getchat(int ChatID)
|
||||
{
|
||||
var response = await _baseController.Get($"{BaseRoute}User/Chat/{ChatID}");
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||
|
||||
@@ -57,14 +57,15 @@ namespace HushianWebApp.Service
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public async Task<List<Read_GroupDto>?> GetGroupsCompany(int CompanyID)
|
||||
public async Task<List<Read_GroupDto>> GetGroupsCompany(int CompanyID)
|
||||
{
|
||||
var response = await _baseController.Get($"{BaseRoute}GetGroupsCompany?CompanyID={CompanyID}");
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
return await response.Content.ReadFromJsonAsync<List<Read_GroupDto>>();
|
||||
var data= await response.Content.ReadFromJsonAsync<List<Read_GroupDto>>();
|
||||
return data==null ?new() : data;
|
||||
}
|
||||
return null;
|
||||
return new();
|
||||
}
|
||||
public async Task<List<Read_GroupDto>?> GetGroupsFromExperID(int ExperID)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user