Skip to content

Commit

Permalink
refactor: task service의 queryBuilder 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
hou27 committed Mar 23, 2023
1 parent 880fd3e commit c46072c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/batch/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ export class TaskService {
level: 'notice',
message: "Check article's deadline : " + utcToday,
});
const contents = await this.contents.find({
where: {
reminder: utcToday,
},
relations: {
user: true,
},
});
const contents = await this.contents
.createQueryBuilder('content')
.leftJoinAndSelect('content.user', 'user')
.where('content.reminder = :reminder', { reminder: utcToday })
.getMany();
if (contents.length > 0) {
// 알림
for (const content of contents) {
Expand Down

0 comments on commit c46072c

Please sign in to comment.