Merge remote-tracking branch 'origin/dev' into feat/user-routes
# Conflicts: # backend/src/controllers/students.ts # backend/src/controllers/teachers.ts # backend/src/data/classes/class-join-request-repository.ts # backend/src/routes/students.ts # backend/src/services/students.ts # backend/src/services/teachers.ts # backend/tests/test_assets/users/students.testdata.ts # frontend/src/controllers/controllers.ts # frontend/src/queries/themes.ts
This commit is contained in:
		
						commit
						7f189188e8
					
				
					 139 changed files with 3594 additions and 3063 deletions
				
			
		| 
						 | 
				
			
			@ -4,7 +4,7 @@ import { Question } from '../../entities/questions/question.entity.js';
 | 
			
		|||
import { Teacher } from '../../entities/users/teacher.entity.js';
 | 
			
		||||
 | 
			
		||||
export class AnswerRepository extends DwengoEntityRepository<Answer> {
 | 
			
		||||
    public createAnswer(answer: { toQuestion: Question; author: Teacher; content: string }): Promise<Answer> {
 | 
			
		||||
    public async createAnswer(answer: { toQuestion: Question; author: Teacher; content: string }): Promise<Answer> {
 | 
			
		||||
        const answerEntity = this.create({
 | 
			
		||||
            toQuestion: answer.toQuestion,
 | 
			
		||||
            author: answer.author,
 | 
			
		||||
| 
						 | 
				
			
			@ -13,13 +13,13 @@ export class AnswerRepository extends DwengoEntityRepository<Answer> {
 | 
			
		|||
        });
 | 
			
		||||
        return this.insert(answerEntity);
 | 
			
		||||
    }
 | 
			
		||||
    public findAllAnswersToQuestion(question: Question): Promise<Answer[]> {
 | 
			
		||||
    public async findAllAnswersToQuestion(question: Question): Promise<Answer[]> {
 | 
			
		||||
        return this.findAll({
 | 
			
		||||
            where: { toQuestion: question },
 | 
			
		||||
            orderBy: { sequenceNumber: 'ASC' },
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    public removeAnswerByQuestionAndSequenceNumber(question: Question, sequenceNumber: number): Promise<void> {
 | 
			
		||||
    public async removeAnswerByQuestionAndSequenceNumber(question: Question, sequenceNumber: number): Promise<void> {
 | 
			
		||||
        return this.deleteWhere({
 | 
			
		||||
            toQuestion: question,
 | 
			
		||||
            sequenceNumber: sequenceNumber,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@ import { Student } from '../../entities/users/student.entity.js';
 | 
			
		|||
import { LearningObject } from '../../entities/content/learning-object.entity.js';
 | 
			
		||||
 | 
			
		||||
export class QuestionRepository extends DwengoEntityRepository<Question> {
 | 
			
		||||
    public createQuestion(question: { loId: LearningObjectIdentifier; author: Student; content: string }): Promise<Question> {
 | 
			
		||||
    public async createQuestion(question: { loId: LearningObjectIdentifier; author: Student; content: string }): Promise<Question> {
 | 
			
		||||
        const questionEntity = this.create({
 | 
			
		||||
            learningObjectHruid: question.loId.hruid,
 | 
			
		||||
            learningObjectLanguage: question.loId.language,
 | 
			
		||||
| 
						 | 
				
			
			@ -21,7 +21,7 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
 | 
			
		|||
        questionEntity.content = question.content;
 | 
			
		||||
        return this.insert(questionEntity);
 | 
			
		||||
    }
 | 
			
		||||
    public findAllQuestionsAboutLearningObject(loId: LearningObjectIdentifier): Promise<Question[]> {
 | 
			
		||||
    public async findAllQuestionsAboutLearningObject(loId: LearningObjectIdentifier): Promise<Question[]> {
 | 
			
		||||
        return this.findAll({
 | 
			
		||||
            where: {
 | 
			
		||||
                learningObjectHruid: loId.hruid,
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +33,7 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
 | 
			
		|||
            },
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    public removeQuestionByLearningObjectAndSequenceNumber(loId: LearningObjectIdentifier, sequenceNumber: number): Promise<void> {
 | 
			
		||||
    public async removeQuestionByLearningObjectAndSequenceNumber(loId: LearningObjectIdentifier, sequenceNumber: number): Promise<void> {
 | 
			
		||||
        return this.deleteWhere({
 | 
			
		||||
            learningObjectHruid: loId.hruid,
 | 
			
		||||
            learningObjectLanguage: loId.language,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue