From db33cd49082f3ab64201e140547d1c07c5fcbcf7 Mon Sep 17 00:00:00 2001 From: laurejablonski Date: Mon, 21 Apr 2025 22:30:10 +0200 Subject: [PATCH] fix: super moet eerst opgeroepen worden + variabele moet geinitialiseerd worden --- frontend/src/controllers/questions.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/controllers/questions.ts b/frontend/src/controllers/questions.ts index 60a51d1a..86f4a56d 100644 --- a/frontend/src/controllers/questions.ts +++ b/frontend/src/controllers/questions.ts @@ -11,28 +11,30 @@ export interface QuestionResponse { } export class QuestionController extends BaseController { + loId: LearningObjectIdentifierDTO; + constructor(loId: LearningObjectIdentifierDTO) { - this.loId = loId; super(`learningObject/${loId.hruid}/:${loId.version}/questions`); + this.loId = loId; } async getAll(full = true): Promise { - return this.get("/", { lang: this.loId.lang, full }); + return this.get("/", { lang: this.loId.language, full }); } async getBy(sequenceNumber: number): Promise { - return this.get(`/${sequenceNumber}`, { lang: this.loId.lang }); + return this.get(`/${sequenceNumber}`, { lang: this.loId.language }); } async create(questionData: QuestionData): Promise { - return this.post("/", questionData, { lang: this.loId.lang }); + return this.post("/", questionData, { lang: this.loId.language }); } async remove(sequenceNumber: number): Promise { - return this.delete(`/${sequenceNumber}`, { lang: this.loId.lang }); + return this.delete(`/${sequenceNumber}`, { lang: this.loId.language }); } async update(sequenceNumber: number, questionData: QuestionData): Promise { - return this.put(`/${sequenceNumber}`, questionData, { lang: this.loId.lang }); + return this.put(`/${sequenceNumber}`, questionData, { lang: this.loId.language }); } }