|
|
|
@ -18,9 +18,10 @@ end
|
|
|
|
|
|
|
|
|
|
json.course_count @course_count
|
|
|
|
|
json.courses @courses.each do |course|
|
|
|
|
|
json.(course, :id, :name, :visits, :course_members_count)
|
|
|
|
|
json.(course, :id, :name, :visits, :course_members_count, :is_end, :invite_code_halt)
|
|
|
|
|
json.creator course.teacher.real_name
|
|
|
|
|
json.avatar_url url_to_avatar(course.teacher)
|
|
|
|
|
json.invite_code course.invite_code_halt == 0 ? course.generate_invite_code : ""
|
|
|
|
|
json.school course.school&.name
|
|
|
|
|
course_member = @category == "study" ? course.students.where(user_id: @user.id).first : course.teachers.where(user_id: @user.id).first
|
|
|
|
|
json.sticky course_member.sticky
|
|
|
|
|