Skip to content

Commit

Permalink
Merge pull request #159 from NCU-Plus/fix/issue-147
Browse files Browse the repository at this point in the history
fix: past courses won't refresh
  • Loading branch information
ppodds committed Nov 7, 2022
2 parents c17e1df + da80c63 commit 32badd0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/frontend/components/courses/CoursesInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
class="text-slate-800 cursor-pointer"
@click="showingPastCourses = !showingPastCourses"
>
查看歷年相同課程<font-awesome-icon
查看歷年相同課程
<font-awesome-icon
v-if="!showingPastCourses"
class="ml-2"
:icon="['fas', 'caret-down']"
Expand Down Expand Up @@ -90,7 +91,6 @@
</template>

<script setup lang="ts">
import { AsyncData } from "#app";
import { Course } from "types/Course";
import {
formatCourseType,
Expand All @@ -99,8 +99,9 @@ import {
} from "~/helpers/course";
const props = defineProps<{ course: Course }>();
const { pending, data: pastCourses } = <AsyncData<Course[], Error>>(
useLazyFetch(`/api/past-courses/${props.course.classNo}`)
const { pending, data: pastCourses } = useLazyFetch<Course[]>(
() => `/api/past-courses/${props.course.classNo}`,
{ key: `/api/past-courses/${props.course.classNo}` },
);
const showingPastCourses = ref(false);
const courses = computed(() => {
Expand Down

0 comments on commit 32badd0

Please sign in to comment.