Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EW-1000 renamed the get course by id API #5188

Merged
merged 4 commits into from
Aug 19, 2024
Merged
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 @@ -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')
Fshmit marked this conversation as resolved.
Show resolved Hide resolved
@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
Loading