Skip to content

Commit

Permalink
fix: course service에서 course 대신 map으로 잘못 표기된 네이밍 수정 #92
Browse files Browse the repository at this point in the history
  • Loading branch information
koomchang committed Nov 13, 2024
1 parent 9fd1523 commit e806031
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions backend/src/course/course.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export class CourseService {
}

async getCourseById(id: number) {
const map = await this.courseRepository.findById(id);
if (!map) throw new CourseNotFoundException(id);
const course = await this.courseRepository.findById(id);
if (!course) throw new CourseNotFoundException(id);

return await CourseDetailResponse.from(map);
return await CourseDetailResponse.from(course);
}

async getCourseOwnerId(courseId: number) {
Expand All @@ -70,9 +70,9 @@ export class CourseService {

async createCourse(userId: number, createCourseForm: CreateCourseRequest) {
const user = { id: userId } as User;
const map = createCourseForm.toEntity(user);
const course = createCourseForm.toEntity(user);

return { id: (await this.courseRepository.save(map)).id };
return { id: (await this.courseRepository.save(course)).id };
}

async deleteCourse(id: number) {
Expand All @@ -82,9 +82,12 @@ export class CourseService {
return { id };
}

async updateCourseInfo(id: number, updateMapForm: UpdateCourseInfoRequest) {
async updateCourseInfo(
id: number,
updateCourseForm: UpdateCourseInfoRequest,
) {
await this.validateCourseExistsById(id);
const { title, description, thumbnailUrl } = updateMapForm;
const { title, description, thumbnailUrl } = updateCourseForm;
return this.courseRepository.updateInfoById(
id,
title,
Expand Down

0 comments on commit e806031

Please sign in to comment.