public async Task <IActionResult> LeaveGroup() { var userId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value); var userToDelete = await _repo.GetGroupUser(userId); _repo.DeleteFromRepo(userToDelete); if (await _repo.SaveAll()) { return(Ok()); } throw new Exception("Nie udało się opuścić grupy"); }