Merge branch 'dev' into fix/213-assignment-and-group-questions

This commit is contained in:
Tibo De Peuter 2025-04-24 10:17:20 +02:00
commit 24899f6766
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
30 changed files with 8842 additions and 497 deletions

View file

@ -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);
}

View file

@ -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;