diff --git a/public/js/api/factory/stv/coursedates.js b/public/js/api/factory/stv/coursedates.js new file mode 100644 index 000000000..71ded7285 --- /dev/null +++ b/public/js/api/factory/stv/coursedates.js @@ -0,0 +1,35 @@ +/** + * Copyright (C) 2025 fhcomplete.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +export default { + getCourselist(params) { + return { + method: 'get', + url: 'api/frontend/v1/stv/LvTermine/getStundenplan/' + params.student_uid + '/' + + params.start_date + '/' + + params.end_date + '/' + + params.group_consecutiveHours + '/' + + params.dbStundenplanTable + }; + }, + getStudiensemester(){ + return { + method: 'get', + url: 'api/frontend/v1/stv/LvTermine/getStudiensemester/' + }; + }, +} \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js b/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js index bc4e02b51..0f1c2f2f0 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js @@ -2,6 +2,8 @@ import {CoreFilterCmpt} from "../../../../filter/Filter.js"; import FormInput from "../../../../Form/Input.js"; import FormForm from '../../../../Form/Form.js'; +import ApiStvCoursedates from "../../../../../api/factory/stv/coursedates.js"; + export default { name: "TblCourseList", components: { @@ -46,16 +48,14 @@ export default { initTabulatorOptions(){ this.tabulatorOptions = { ajaxURL: 'dummy', - ajaxRequestFunc: this.$fhcApi.factory.stv.courselist.getCourselist, - ajaxParams: () => { - return { + ajaxRequestFunc: () => this.$api.call( + ApiStvCoursedates.getCourselist({ student_uid: this.student.uid, start_date: this.dataSem.start, end_date: this.dataSem.ende, group_consecutiveHours: true, - dbStundenplanTable: this.dbStundenplanTable - }; - }, + dbStundenplanTable: this.dbStundenplanTable}) + ), ajaxResponse: (url, params, response) => { return response.data; }, @@ -153,7 +153,8 @@ export default { }, }, created(){ - this.$fhcApi.factory.stv.courselist.getStudiensemester() + this.$api + .call(ApiStvCoursedates.getStudiensemester()) .then(result => { this.listStudiensemester = result.data; this.getDatesOfSemester(this.currentSemester);