mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 09:38:51 +02:00
fix:#26 lint and format
This commit is contained in:
@ -20,7 +20,9 @@ export async function fetchCourse(): Promise<string[]> {
|
||||
return courses;
|
||||
}
|
||||
|
||||
export async function fetchCourseBySemester(semester: string): Promise<string[]> {
|
||||
export async function fetchCourseBySemester(
|
||||
semester: string,
|
||||
): Promise<string[]> {
|
||||
const courses: string[] = [];
|
||||
await fetch("/api/courses?semester=" + semester)
|
||||
.then((response) => {
|
||||
|
@ -1,7 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ComputedRef, Ref, ref, watch } from "vue";
|
||||
import { fetchCourseBySemester,
|
||||
fetchModulesByCourseAndSemester
|
||||
import {
|
||||
fetchCourseBySemester,
|
||||
fetchModulesByCourseAndSemester,
|
||||
} from "../api/fetchCourse";
|
||||
import DynamicPage from "./DynamicPage.vue";
|
||||
import ModuleSelection from "../components/ModuleSelection.vue";
|
||||
@ -18,7 +19,9 @@ async function getModules() {
|
||||
}
|
||||
|
||||
async function getCourses() {
|
||||
courses.value = await fetchCourseBySemester(selectedSemester.value.value).then((data) => {
|
||||
courses.value = await fetchCourseBySemester(
|
||||
selectedSemester.value.value,
|
||||
).then((data) => {
|
||||
return data.map((course) => {
|
||||
return { name: course };
|
||||
});
|
||||
@ -29,7 +32,7 @@ const store = moduleStore();
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
const selectedCourse: Ref<{ name: string }> = ref({ name: "" });
|
||||
const courses: Ref<{ name: string; }[]> = ref([]);
|
||||
const courses: Ref<{ name: string }[]> = ref([]);
|
||||
const modules: Ref<Module[]> = ref([]);
|
||||
|
||||
const semesters: ComputedRef<{ name: string; value: string }[]> = computed(
|
||||
@ -53,8 +56,6 @@ watch(
|
||||
|
||||
// init the courses dropdown with the first semester that is default selected
|
||||
getCourses();
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Reference in New Issue
Block a user