Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ private async Task<CourseViewModel> ToCourseViewModel(CourseDTO course)
Homeworks = course.Homeworks,
IsCompleted = course.IsCompleted,
IsOpen = course.IsOpen,
Description = course.Description,
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class CreateCourseViewModel
public List<string> StudentIDs { get; set; } = new List<string>();
public bool FetchStudents { get; set; }
[Required] public bool IsOpen { get; set; }
public string Description { get; set; }
public long? BaseCourseId { get; set; }
}

Expand All @@ -30,6 +31,8 @@ public class UpdateCourseViewModel
[Required] public bool IsOpen { get; set; }

public bool IsCompleted { get; set; }

public string Description { get; set; }
}

public class CourseDTO : CoursePreview
Expand All @@ -50,6 +53,7 @@ public class CourseViewModel
public string GroupName { get; set; }
public bool IsOpen { get; set; }
public bool IsCompleted { get; set; }
public string Description { get; set; }

public AccountDataDto[] Mentors { get; set; }
public AccountDataDto[] AcceptedStudents { get; set; }
Expand All @@ -66,5 +70,6 @@ public class CoursePreview
public bool IsCompleted { get; set; }
public string[] MentorIds { get; set; }
public long? TaskId { get; set; }
public string Description { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,7 @@ public async Task<IActionResult> DeleteCourse(long courseId)
[ServiceFilter(typeof(CourseMentorOnlyAttribute))]
public async Task<IActionResult> UpdateCourse(long courseId, [FromBody] UpdateCourseViewModel courseViewModel)
{
await _coursesService.UpdateAsync(courseId, new Course
{
Name = courseViewModel.Name,
GroupName = courseViewModel.GroupName,
IsCompleted = courseViewModel.IsCompleted,
IsOpen = courseViewModel.IsOpen
});

await _coursesService.UpdateAsync(courseId, courseViewModel);
return Ok();
}

Expand Down
Loading