Display correct profile filter when none is chosen yet

This commit is contained in:
Ramon Wenger 2024-08-05 22:05:20 +02:00 committed by Christian Cueni
parent c50b19d0d7
commit 4d3ab9ce39
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
<script lang="ts" setup>
import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue";
import { COURSE_PROFILE_ALL_FILTER } from "@/constants";
import type { DropdownSelectable } from "@/types";
import { useTranslation } from "i18next-vue";
import { computed } from "vue";
@ -21,7 +22,10 @@ const selectedItem = computed(() => {
if (props.selected) {
return { id: props.selected || "", name: t(`profile.${props.selected}`) };
}
return { id: "", name: "" };
return {
id: COURSE_PROFILE_ALL_FILTER,
name: t(`profile.${COURSE_PROFILE_ALL_FILTER}`),
};
});
const updateFilter = (e: DropdownSelectable) => {