не работает...
This commit is contained in:
parent
704426540e
commit
3b9bca0157
@ -13,8 +13,7 @@ namespace SushiBarClientApp
|
||||
{
|
||||
_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)
|
||||
{
|
||||
|
@ -19,8 +19,7 @@ namespace SushiBarClientApp.Controllers
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return
|
||||
View(APIClient.GetRequest<List<OrderViewModel>>($"api/main/getorders?clientId={APIClient.Client.Id}"));
|
||||
return View(APIClient.GetRequest<List<OrderViewModel>>($"api/main/getorders?clientId={APIClient.Client.Id}"));
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult Privacy()
|
||||
@ -139,10 +138,8 @@ namespace SushiBarClientApp.Controllers
|
||||
[HttpPost]
|
||||
public double Calc(int count, int sushi)
|
||||
{
|
||||
var prod =
|
||||
APIClient.GetRequest<SushiViewModel>($"api/main/getsushi?sushiId={sushi}"
|
||||
);
|
||||
return count * (prod?.Price ?? 1);
|
||||
var sush = APIClient.GetRequest<SushiViewModel>($"api/main/getsushi?sushiId={sushi}");
|
||||
return count * (sush?.Price ?? 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,10 @@
|
||||
<ProjectReference Include="..\SushiBarBusinessLogic\SushiBarBusinessLogic.csproj" />
|
||||
<ProjectReference Include="..\SushiBarContracts\SushiBarContracts.csproj" />
|
||||
<ProjectReference Include="..\SushiBarDatabaseImplement\SushiBarDatabaseImplement.csproj" />
|
||||
<ProjectReference Include="..\SushiBarDataModels\SushiBarDataModels.csproj" />
|
||||
<ProjectReference Include="..\SushiBarFileImplement\SushiBarFileImplement.csproj" />
|
||||
<ProjectReference Include="..\SushiBarListImplement\SushiBarListImplement.csproj" />
|
||||
<ProjectReference Include="..\SushiBarRestApi\SushiBarRestApi.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -72,4 +72,4 @@
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user