Merge branch 'dev' into fix/213-assignment-and-group-questions
This commit is contained in:
		
						commit
						24899f6766
					
				
					 30 changed files with 8842 additions and 497 deletions
				
			
		|  | @ -1,4 +1,4 @@ | |||
| import { Collection, Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; | ||||
| import { Cascade, Collection, Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; | ||||
| import { Class } from '../classes/class.entity.js'; | ||||
| import { Group } from './group.entity.js'; | ||||
| import { Language } from '@dwengo-1/common/util/language'; | ||||
|  | @ -34,6 +34,7 @@ export class Assignment { | |||
|     @OneToMany({ | ||||
|         entity: () => Group, | ||||
|         mappedBy: 'assignment', | ||||
|         cascade: [Cascade.ALL], | ||||
|     }) | ||||
|     groups: Collection<Group> = new Collection<Group>(this); | ||||
| } | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import { Student } from '../users/student.entity.js'; | ||||
| import { Group } from './group.entity.js'; | ||||
| import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | ||||
| import { Entity, Enum, ManyToOne, PrimaryKey, Property, Cascade } from '@mikro-orm/core'; | ||||
| import { SubmissionRepository } from '../../data/assignments/submission-repository.js'; | ||||
| import { Language } from '@dwengo-1/common/util/language'; | ||||
| 
 | ||||
|  | @ -21,8 +21,8 @@ export class Submission { | |||
|     @PrimaryKey({ type: 'numeric', autoincrement: false }) | ||||
|     learningObjectVersion = 1; | ||||
| 
 | ||||
|     @ManyToOne({ | ||||
|         entity: () => Group, | ||||
|     @ManyToOne(() => Group, { | ||||
|         cascade: [Cascade.REMOVE], | ||||
|     }) | ||||
|     onBehalfOf!: Group; | ||||
| 
 | ||||
|  |  | |||
		Reference in a new issue