add a getmatch endpoint

This commit is contained in:
Ryan Peters 2023-07-08 08:11:39 -04:00
parent 46bf68e9ad
commit a7688efcb9

View File

@ -42,6 +42,19 @@ public class HomeController : Controller
return View();
}
public IActionResult GetMatch(Guid id)
{
var match = dbContext.Matches
.Include(m => m.Deck)
.Include(m => m.PlayerOne)
.ThenInclude(p => p.HandCards)
.Include(m => m.PlayerTwo)
.ThenInclude(p => p.HandCards)
.FirstOrDefault(m => m.Id == id);
return Ok(match);
}
public async Task<IActionResult> CreateMatch(Guid userOneGuid, Guid userTwoGuid)
{
var playerOne = new Player