예제 #1
0
        public async Task <IActionResult> UpdateStudyDetailsAsync(int studyId,
                                                                  [ModelBinder(BinderType = typeof(JsonModelBinder))] StudyUpdateDto study,
                                                                  IFormFile image = null)
        {
            var updatedStudy = await _studyUpdateService.UpdateMetadataAsync(studyId, study, image);

            var studyDetails = await _studyDetailsService.Get(studyId);

            return(new JsonResult(studyDetails));
        }
예제 #2
0
        public async Task <IActionResult> CreateStudyAsync(
            [ModelBinder(BinderType = typeof(JsonModelBinder))] StudyCreateDto study,
            IFormFile image = null)
        {
            var createdStudy = await _studyCreateService.CreateAsync(study, image);

            var studyDetails = await _studyDetailsService.Get(createdStudy.Id);

            return(new JsonResult(studyDetails));
        }
예제 #3
0
        public async Task <IActionResult> GetAsync(int studyId)
        {
            var study = await _studyDetailsService.Get(studyId);

            return(new JsonResult(study));
        }