-
-
Versicherungsvermittler/in
-
![]()
-
- {{ $t("general.nextStep") }}
-
-
-
-
Überbetriebliche Kurse
-
![]()
-
+
+
+
+
+
{{ courseSession.title }}
+
![]()
+
+ {{ $t("general.nextStep") }}
+
+
diff --git a/client/src/stores/courseSessions.ts b/client/src/stores/courseSessions.ts
new file mode 100644
index 00000000..cdecd32c
--- /dev/null
+++ b/client/src/stores/courseSessions.ts
@@ -0,0 +1,32 @@
+import { itGet } from "@/fetchHelpers";
+import type { CourseSession } from "@/types";
+import log from "loglevel";
+import { defineStore } from "pinia";
+import { ref } from "vue";
+
+export const useCourseSessionsStore = defineStore("courseSessions", () => {
+ const courseSessions = ref
(undefined);
+ let loadPromise: Promise | undefined = undefined;
+
+ async function loadCourseSessionsData(reload = false) {
+ log.debug("loadCourseSessionsData called");
+ if (courseSessions.value && !reload) {
+ return courseSessions.value;
+ }
+
+ if (!loadPromise) {
+ loadPromise = itGet(`/api/course/sessions/`);
+ }
+
+ const courseSessionsData = await loadPromise;
+
+ if (!courseSessionsData) {
+ throw `No courseSessionData found for user`;
+ }
+
+ courseSessions.value = courseSessionsData;
+ return courseSessionsData || [];
+ }
+
+ return { courseSessions, loadCourseSessionsData };
+});
diff --git a/client/src/types.ts b/client/src/types.ts
index 668f06b4..78928b91 100644
--- a/client/src/types.ts
+++ b/client/src/types.ts
@@ -301,3 +301,28 @@ export interface DropdownListItem {
icon: Component;
data: object;
}
+
+export interface CircleExpert {
+ user_id: number;
+ user_email: string;
+ user_first_name: string;
+ user_last_name: string;
+ circle_id: number;
+ circle_slug: string;
+ circle_translation_key: string;
+}
+
+export interface CourseSession {
+ id: number;
+ created_at: string;
+ updated_at: string;
+ course: Course;
+ title: string;
+ start_date: string;
+ end_date: string;
+ learning_path_url: string;
+ competence_url: string;
+ media_library_url: string;
+ additional_json_data: unknown;
+ experts: CircleExpert[];
+}