Conversation
|
| # turbo | ||
| .turbo | ||
|
|
||
| backend/* No newline at end of file |
| department: data.department || "", | ||
| credit: new Prisma.Decimal(data.credit), | ||
| creditHours: data.creditHours || "", |
There was a problem hiding this comment.
Do not use empty string as a empty value. Use NULL instead.
"Empty string" means "The string that have length 0" while "null" means "really nothing" data type
| const sortedItems = [...items].sort( | ||
| (a, b) => (a.cartOrder ?? 0) - (b.cartOrder ?? 0) | ||
| (a, b) => (a.cartOrder ?? 0) - (b.cartOrder ?? 0), | ||
| ); |
There was a problem hiding this comment.
sorting should be Database task. Not service
| gradingType: | ||
| data.creditHours && data.creditHours.includes("S/U") | ||
| ? GradingType.SU | ||
| : GradingType.LETTER, | ||
| academicYear: parseInt(data.academicYear), | ||
| semester: mapSemester(data.semester), | ||
| studyProgram: mapStudyProgram(data.studyProgram), |
There was a problem hiding this comment.
I don't think you have to map semester and study program. Just generated enum as a controller's input
Why did you create this PR
Note: To ensure CourseInfo updates correctly per Semester, AcademicYear, and StudyProgram, some attribute need to be modified. Since these changes will directly impact the Course API, I haven't implemented them yet and left some comment in the schema for now.