finish
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m25s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s

This commit is contained in:
2024-04-21 09:46:46 +02:00
parent ecaf5e3df8
commit 0621c6fe68
7 changed files with 31 additions and 90 deletions

View File

@ -8,16 +8,16 @@
<script setup>
import { ref, reactive } from 'vue'
import i18n from '@/i18n.js'
import { getCourses } from '@/rest/courses.js'
import { getCourses, getUserActualCourses } from '@/rest/courses.js'
import { ForumsOfCurrentCourse, getForumsOfCourse, createForum } from '@/rest/forum.js'
import { PostsOfCurrentForum, getPostsOfForum, createPost } from '@/rest/forum.js'
import { fetchedPost, fetchPost, sendAnswer } from '@/rest/forum.js'
import { getSelf } from '@/rest/Users.js'
const courses = await reactive(getCourses());
const Role = (await getSelf()).role;
const courses = Role === 'Admin' || Role === 'Secretary' ? await reactive(getCourses()) : await reactive(getUserActualCourses());
const selectedCourse = ref();
const selectedForum = ref();
const Role = (await getSelf()).role;
const addForumName = ref("");
const addPost = ref(false);
@ -30,7 +30,7 @@ const addPostContent = ref("");
<div id="app">
<div id="ForumSelector">
<select id="cours" value="" v-model="selectedCourse" @change="getForumsOfCourse(selectedCourse)">
<option v-for="course in courses" :value="course.courseId">{{course.title}}</option>
<option v-for="course in courses" :value="course.courseID">{{course.title}}</option>
</select>
<select id="forum" value="" v-model="selectedForum" @change="getPostsOfForum(selectedForum !== 'create' ? selectedForum : null)" v-if="ForumsOfCurrentCourse != null">