Exemple #1
0
        public ActionResult <TestimonialViewModel> AddTestimonialToInternship(int id, [FromBody] AddTestimonialViewModel testimonialViewModel)
        {
            var userId           = User.GetUserId();
            var student          = _studentService.GetStudentByUserId(userId);
            var studentId        = student.Id;
            var internshipId     = id;
            var addedTestimonial = _internshipService
                                   .AddTestimonial(StudentRatingsMapper.ToRatingWithTestimonialDbObject(testimonialViewModel, studentId, internshipId));

            return(Ok(StudentRatingsMapper.ToTestimonial(addedTestimonial)));
        }