Exemple #1
0
        public ActionResult <AddRatingViewModel> AddRatingToInternship(int id, [FromBody] AddRatingViewModel ratingViewModel)
        {
            var userId       = User.GetUserId();
            var student      = _studentService.GetStudentByUserId(userId);
            var studentId    = student.Id;
            var internshipId = id;
            var addedRating  = _internshipService
                               .AddRating(StudentRatingsMapper.ToRatingDbObject(ratingViewModel, studentId, internshipId));

            return(Ok(StudentRatingsMapper.ToAddRatingViewModel(addedRating)));
        }