fix:#26 lint and format

This commit is contained in:
Elmar Kresse
2024-02-02 00:27:48 +01:00
parent 25a7464e41
commit 5b45621ed1
2 changed files with 10 additions and 7 deletions

View File

@ -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) => {

View File

@ -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>