Skip to content

Commit

Permalink
feat: 코스 최신순 정렬
Browse files Browse the repository at this point in the history
  • Loading branch information
Miensoap committed Dec 3, 2024
1 parent 95cc222 commit e6c2859
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion backend/src/course/CourseRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@ export class CourseRepository extends SoftDeleteRepository<Course, number> {
where: { isPublic: true },
skip: (page - 1) * pageSize,
take: pageSize,
order: {
createdAt: 'DESC',
},
});
}

searchByTitleQuery(title: string, page: number, pageSize: number) {
return this.find({
where: { title: ILike(`%${title}%`), isPublic: true },
where: {
title: ILike(`%${title}%`),
isPublic: true,
},
skip: (page - 1) * pageSize,
take: pageSize,
order: {
createdAt: 'DESC',
},
});
}

Expand All @@ -36,6 +45,9 @@ export class CourseRepository extends SoftDeleteRepository<Course, number> {
where: { user: { id: userId } },
skip: (page - 1) * pageSize,
take: pageSize,
order: {
createdAt: 'DESC',
},
});
}

Expand Down

0 comments on commit e6c2859

Please sign in to comment.