fix: adds circle title

This commit is contained in:
Livio Bieri 2023-12-15 13:29:11 +01:00
parent bad9ed1926
commit c7e457d138
1 changed files with 9 additions and 0 deletions

View File

@ -44,6 +44,14 @@ export const useMentorCockpit = (
const summary: Ref<Summary | null> = ref(null);
const error = ref(null);
const getCircleTitleById = (id: string): string => {
if (summary.value?.circles) {
const circle = summary.value.circles.find((circle) => String(circle.id) === id);
return circle ? circle.title : "";
}
return "";
};
const fetchData = () => {
summary.value = null;
error.value = null;
@ -66,5 +74,6 @@ export const useMentorCockpit = (
isLoading,
summary,
error,
getCircleTitleById,
};
};