Skip to content

Commit

Permalink
EW-1000 renamed the get course by id API to cc-metadata (#5188)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fshmit authored Aug 19, 2024
1 parent 36771d1 commit edf129b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ describe('Course Controller (API)', () => {
});
});

describe('[GET] /courses/:courseId', () => {
describe('[GET] /courses/:courseId/cc-metadata', () => {
const setup = async () => {
const teacher = createTeacher();
const course = courseFactory.buildWithId({
Expand All @@ -263,7 +263,7 @@ describe('Course Controller (API)', () => {
const { course, teacher } = await setup();

const loggedInClient = await testApiClient.login(teacher.account);
const response = await loggedInClient.get(`${course.id}`);
const response = await loggedInClient.get(`${course.id}/cc-metadata`);
const data = response.body as CourseCommonCartridgeMetadataResponse;

expect(response.statusCode).toBe(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ export class CourseController {
};
}

@Get(':courseId')
@Get(':courseId/cc-metadata')
@ApiOperation({ summary: 'Get common cartridge metadata of a course by Id.' })
@ApiBadRequestResponse({ description: 'Request data has invalid format.' })
@ApiInternalServerErrorResponse({ description: 'Internal server error.' })
public async getCourseById(@Param() param: CourseUrlParams): Promise<CourseCommonCartridgeMetadataResponse> {
public async getCourseCcMetadataById(
@Param() param: CourseUrlParams
): Promise<CourseCommonCartridgeMetadataResponse> {
const course = await this.courseUc.findCourseById(param.courseId);

return CourseMapper.mapToCommonCartridgeMetadataResponse(course);
Expand Down

0 comments on commit edf129b

Please sign in to comment.