Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #180 from gsainfoteam/prod-semester
Browse files Browse the repository at this point in the history
fix: when there are no records in prof.
  • Loading branch information
minjunj authored Feb 26, 2024
2 parents dd5dd49 + 44d15c6 commit 66f11e9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/scoring/scoring.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export class ScoringService {
},
},
});
//console.log("getLectureinfo's found : ", found);

if (!found) {
throw new NotFoundException(
Expand All @@ -150,14 +149,21 @@ export class ScoringService {
},
},
});
//console.log('getLectureInfo result: ', lecture);
return lecture;
if (lecture === null) {
throw new NotFoundException('아직 작성된 강의평이 없습니다.');
} else {
return lecture;
}
}
}

// 강의 평점 계산 & 6개 평가 지표 API
async scoring(main_lecture_id: number, prof_id?: number): Promise<any> {
const lecture = await this.getLectureInfo(Number(main_lecture_id), prof_id); //1곱하지말고 parseInt pipe만드는게 좋을듯
const lecture = await this.getLectureInfo(
Number(main_lecture_id),
Number(prof_id),
); //1곱하지말고 parseInt pipe만드는게 좋을듯
console.log(lecture);
const people = lecture.records.length;
const found = await this.scoringRepository.findOne({
where: {
Expand Down

0 comments on commit 66f11e9

Please sign in to comment.