Skip to content

Commit

Permalink
feat: add ClassDTO, add some onDelete behaviour to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
M7s7 committed Nov 1, 2023
1 parent 20ab8d5 commit a23f6cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ model Event {
day String
start DateTime
end DateTime
timetable Timetable? @relation(fields: [timetableId], references: [id])
timetable Timetable? @relation(fields: [timetableId], references: [id], onDelete: Cascade)
timetableId String?
}

Expand Down
7 changes: 6 additions & 1 deletion server/src/user/dto/timetable.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export class TimetableDto {
@IsArray()
@IsString({ each: true })
selectedCourses: string[];

events: EventDto[];
}

Expand All @@ -22,3 +21,9 @@ export class EventDto {
start: Date;
end: Date;
}

export class ClassDto {
id: string;
classType: string;
courseName: string;
}

0 comments on commit a23f6cd

Please sign in to comment.