Skip to content

Commit

Permalink
Merge pull request #6134 from Aminehassou/AddStudentProgramEndpoint
Browse files Browse the repository at this point in the history
Removed unneeded fields from new endpoint
  • Loading branch information
ragesoss authored Jan 21, 2025
2 parents 88a89ec + 870425a commit 50c833a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/controllers/courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ def alerts
def classroom_program_students_json
courses = Course.classroom_program_students
render json: courses.as_json(
only: %i[title created_at updated_at start end school term slug],
only: %i[title school slug],
include: {
students: {
only: %i[username created_at updated_at permissions]
only: %i[username]
}
}
)
Expand All @@ -154,13 +154,13 @@ def classroom_program_students_json
def classroom_program_students_and_instructors_json
courses = Course.classroom_program_students_and_instructors
render json: courses.as_json(
only: %i[title created_at updated_at start end school term slug],
only: %i[title school slug],
include: {
students: {
only: %i[username created_at updated_at permissions]
only: %i[username]
},
instructors: {
only: %i[username created_at updated_at permissions]
only: %i[username]
}
}
)
Expand All @@ -169,10 +169,10 @@ def classroom_program_students_and_instructors_json
def fellows_cohort_students_json
courses = Course.fellows_cohort_students
render json: courses.as_json(
only: %i[title created_at updated_at start end school term slug],
only: %i[title school slug],
include: {
students: {
only: %i[username created_at updated_at permissions]
only: %i[username]
}
}
)
Expand All @@ -181,13 +181,13 @@ def fellows_cohort_students_json
def fellows_cohort_students_and_instructors_json
courses = Course.fellows_cohort_students_and_instructors
render json: courses.as_json(
only: %i[title created_at updated_at start end school term slug],
only: %i[title school slug],
include: {
students: {
only: %i[username created_at updated_at permissions]
only: %i[username]
},
instructors: {
only: %i[username created_at updated_at permissions]
only: %i[username]
}
}
)
Expand Down

0 comments on commit 50c833a

Please sign in to comment.