public async Task <IActionResult> GetCartForComponent([FromServices] GetCart getCart) { var userId = User?.Claims?.FirstOrDefault(x => x.Type.Equals(ClaimTypes.NameIdentifier))?.Value; if (string.IsNullOrEmpty(userId)) { return(BadRequest("Cookie Policy not accepted")); } return(Ok(await getCart.GetCartForComponent(userId))); }