From c7e457d13845e19923f4f1b7b835933c7c668481 Mon Sep 17 00:00:00 2001 From: Livio Bieri Date: Fri, 15 Dec 2023 13:29:11 +0100 Subject: [PATCH] fix: adds circle title --- client/src/services/mentorCockpit.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/src/services/mentorCockpit.ts b/client/src/services/mentorCockpit.ts index 95371c58..569a3252 100644 --- a/client/src/services/mentorCockpit.ts +++ b/client/src/services/mentorCockpit.ts @@ -44,6 +44,14 @@ export const useMentorCockpit = ( const summary: Ref = 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, }; };