Лабораторная_7
This commit is contained in:
parent
af3261f0cb
commit
6bdc77b685
@ -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)
|
||||
{
|
||||
|
@ -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}"));
|
||||
}
|
||||
}
|
||||
}
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user