Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed Apr 16, 2024
1 parent 84f6d1b commit 41d6ff3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
10 changes: 7 additions & 3 deletions frontend/src/views/courses/roles/AssistantCourseView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ const props = defineProps<{
const { t } = useI18n();
const { projects, getProjectsByCourse } = useProject();
watch(() => props.course, async () => {
await getProjectsByCourse(props.course.id);
}, { immediate: true });
watch(
() => props.course,
async () => {
await getProjectsByCourse(props.course.id);
},
{ immediate: true },
);
</script>

<template>
Expand Down
27 changes: 15 additions & 12 deletions frontend/src/views/courses/roles/StudentCourseView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,33 @@ const { projects, getProjectsByCourse } = useProject();
const { push } = useRouter();
/* Methods */
async function leaveCourse (): Promise<void> {
async function leaveCourse(): Promise<void> {
// Show a confirmation dialog before leaving the course, to prevent accidental clicks
confirm.require({
message: t('confirmations.leave_course'),
header: t('views.courses.leave'),
accept: async () => {
accept: (): void => {
if (user.value !== null) {
// Leave the course
await studentLeaveCourse(props.course.id, user.value.id);
// Refresh the user so the course is removed from the user's courses
await refreshUser();
// Redirect to the dashboard
await push({ name: 'dashboard' });
studentLeaveCourse(props.course.id, user.value.id).then(() => {
// Refresh the user so the course is removed from the user's courses
refreshUser();
// Redirect to the dashboard
push({ name: 'dashboard' });
});
}
},
reject: () => {},
});
}
watch(() => props.course, async () => {
await getProjectsByCourse(props.course.id);
}, { immediate: true });
watch(
() => props.course,
async () => {
await getProjectsByCourse(props.course.id);
},
{ immediate: true },
);
</script>

<template>
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/views/courses/roles/TeacherCourseView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ async function handleClone(): Promise<void> {
});
}
watch(() => props.course, async () => {
await getProjectsByCourse(props.course.id);
}, { immediate: true });
watch(
() => props.course,
async () => {
await getProjectsByCourse(props.course.id);
},
{ immediate: true },
);
</script>

<template>
Expand Down

0 comments on commit 41d6ff3

Please sign in to comment.