Лабораторная_7

This commit is contained in:
yuliya.mavrina@internet.ru 2024-05-15 08:37:13 +03:00
parent af3261f0cb
commit 6bdc77b685
3 changed files with 4 additions and 10 deletions

View File

@ -13,8 +13,7 @@ namespace RenovationWorkClientApp
{
_client.BaseAddress = new Uri(configuration["IPAddress"]);
_client.DefaultRequestHeaders.Accept.Clear();
_client.DefaultRequestHeaders.Accept.Add(new
MediaTypeWithQualityHeaderValue("application/json"));
_client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
}
public static T? GetRequest<T>(string requestUrl)
{

View File

@ -125,8 +125,7 @@ namespace RenovationWorkClientApp.Controllers
{
throw new Exception("Количество и сумма должны быть\r\nбольше 0");
}
APIClient.PostRequest("api/main/createorder", new
OrderBindingModel
APIClient.PostRequest("api/main/createorder", new OrderBindingModel
{
ClientId = APIClient.Client.Id,
RepairId = repair,
@ -148,8 +147,7 @@ namespace RenovationWorkClientApp.Controllers
{
return Redirect("~/Home/Enter");
}
return
View(APIClient.GetRequest<List<MessageInfoViewModel>>($"api/client/getmessages?clientId={APIClient.Client.Id}"));
return View(APIClient.GetRequest<List<MessageInfoViewModel>>($"api/client/getmessages?clientId={APIClient.Client.Id}"));
}
}
}

View File

@ -55,10 +55,7 @@ namespace RenovationWorkRestApi.Controllers
{
try
{
return _mailLogic.ReadList(new MessageInfoSearchModel
{
ClientId = clientId
});
return _mailLogic.ReadList(new MessageInfoSearchModel{ ClientId = clientId });
}
catch (Exception ex)
{