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