public IActionResult GetAllUserContainers() { try { //TODO: Create new service for this var userId = int.Parse(HttpContext.User .Claims.First(c => c.Type == JwtRegisteredClaimNames.Sub) .Value); var containers = _machineService.GetAllUserContainers(userId); return(Ok(containers)); } catch { return(BadRequest("Error: User's containers not found or user do not make purchase yet")); } }