Skip to content

Commit

Permalink
FIX:formatting for the popular course by tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreyasMandlik committed Jul 5, 2023
1 parent 76a7c31 commit cb1101d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/course/course.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class CourseController {
return await this.courseService.filterByTags(tags);
}

@Get('popular/filterByTags')
@Get('popular/filterByTags')
async filterPopularCourseByTags(
@Query('tags') tags: string[],
): Promise<Course[]> {
Expand Down
4 changes: 1 addition & 3 deletions backend/src/course/course.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ export class CourseService {
},
},
});
console.log(courseTags);
const courseTagIds = courseTags.map((tag) => tag.courseId);
console.log(courseTagIds);
const filteredPopularCourses = popularCourses.filter((course) =>
courseTagIds.includes(course.id),
);
Expand Down Expand Up @@ -184,7 +182,7 @@ export class CourseService {
const updateCourseResponse = await this.prismaService.course.update({
where: { id: id },
data: {
name:updateCourse.name,
name: updateCourse.name,
resourseUrls: updateCourse.resourseUrls,
imageUrl: updateCourse.imageUrl,
testUrls: updateCourse.testUrls,
Expand Down

0 comments on commit cb1101d

Please sign in to comment.