コード例 #1
0
        public IActionResult GetCompletedSessionsByUserId(string uid)
        {
            var userId = _UsersRepository.GetUserByFirebaseUID(uid);

            if (userId == null)
            {
                return(Ok("No swiped sessions for that user yet."));
            }
            var completedSessions  = _repository.GetCompletedSessionsByUserId(userId.ID);
            var noCompletedSession = !completedSessions.Any();

            if (noCompletedSession)
            {
                NotFound("You don't have any open sessions");
            }
            return(Ok(completedSessions));
        }