Skip to content

Commit

Permalink
[BE#459] 카테고리 없는 경우 / 기타가 가장 많은 경우 구분
Browse files Browse the repository at this point in the history
  • Loading branch information
victolee0 authored Dec 14, 2023
1 parent 2e3942e commit d7e845a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BE/src/study-logs/study-logs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ export class StudyLogsService {
LIMIT 1`,
[user_id, start_date, end_date],
);
return primary_category[0].name ?? null;
return primary_category[0]?.name === null
? '기타'
: primary_category[0]?.name ?? null;
}
async groupByCategory(user_id: number, date: string): Promise<object> {
const studyLogsByCategory = await this.studyLogsRepository.query(
Expand Down

0 comments on commit d7e845a

Please sign in to comment.