diff --git a/client/src/pages/learningPath/learningPathPage/LearningPathListView.vue b/client/src/pages/learningPath/learningPathPage/LearningPathListView.vue index e4f6fd56..334331ad 100644 --- a/client/src/pages/learningPath/learningPathPage/LearningPathListView.vue +++ b/client/src/pages/learningPath/learningPathPage/LearningPathListView.vue @@ -1,6 +1,6 @@ + + diff --git a/client/src/router/index.ts b/client/src/router/index.ts index 1bbfcb90..618a7040 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -391,6 +391,12 @@ const router = createRouter({ component: () => import("@/pages/onboarding/uk/SetupComplete.vue"), name: "setupComplete", }, + { + path: "account/course-profile", + component: () => import("@/pages/onboarding/vv/AccountCourseProfile.vue"), + name: "accountCourseProfile", + props: true, + }, { path: "checkout/address", component: () => import("@/pages/onboarding/vv/CheckoutAddress.vue"), diff --git a/client/src/services/entities.ts b/client/src/services/entities.ts index 2de7f01c..588627b1 100644 --- a/client/src/services/entities.ts +++ b/client/src/services/entities.ts @@ -13,14 +13,21 @@ export type Country = { name: string; }; +export type CourseProfile = { + id: number; + code: string; +}; + export function useEntities() { const countries: Ref = ref([]); const organisations: Ref = ref([]); + const courseProfiles: Ref = ref([]); itGetCached("/api/core/entities/").then((res: any) => { countries.value = res.countries; organisations.value = res.organisations; + courseProfiles.value = res.courseProfiles; }); - return { organisations, countries }; + return { organisations, countries, courseProfiles }; } diff --git a/client/src/services/onboarding.ts b/client/src/services/onboarding.ts index 9c59ef48..1b2e4d5e 100644 --- a/client/src/services/onboarding.ts +++ b/client/src/services/onboarding.ts @@ -11,7 +11,7 @@ export function profileNextRoute(courseType: string | string[]) { } // vv- -> vv-de, vv-fr or vv-it if (isString(courseType) && startsWith(courseType, "vv-")) { - return "checkoutAddress"; + return "accountCourseProfile"; } return ""; } diff --git a/server/vbv_lernwelt/api/directory.py b/server/vbv_lernwelt/api/directory.py index bc5d9673..9f843c87 100644 --- a/server/vbv_lernwelt/api/directory.py +++ b/server/vbv_lernwelt/api/directory.py @@ -4,6 +4,8 @@ from rest_framework.response import Response from vbv_lernwelt.core.models import Country, Organisation from vbv_lernwelt.core.serializers import CountrySerializer, OrganisationSerializer +from vbv_lernwelt.learnpath.models import CourseProfile +from vbv_lernwelt.learnpath.serializers import CourseProfileSerializer @api_view(["GET"]) @@ -26,4 +28,13 @@ def list_entities(request): countries = CountrySerializer( Country.objects.all(), many=True, context=context ).data - return Response({"organisations": organisations, "countries": countries}) + course_profiles = CourseProfileSerializer( + CourseProfile.objects.all(), many=True, context=context + ).data + return Response( + { + "organisations": organisations, + "countries": countries, + "courseProfiles": course_profiles, + } + ) diff --git a/server/vbv_lernwelt/api/user.py b/server/vbv_lernwelt/api/user.py index dccad63b..248030c2 100644 --- a/server/vbv_lernwelt/api/user.py +++ b/server/vbv_lernwelt/api/user.py @@ -1,4 +1,3 @@ -from django.shortcuts import get_object_or_404 from rest_framework.decorators import api_view, permission_classes from rest_framework.generics import get_object_or_404 from rest_framework.permissions import IsAuthenticated diff --git a/server/vbv_lernwelt/learnpath/serializers.py b/server/vbv_lernwelt/learnpath/serializers.py index 3f6a3255..b03a7dbf 100644 --- a/server/vbv_lernwelt/learnpath/serializers.py +++ b/server/vbv_lernwelt/learnpath/serializers.py @@ -1,3 +1,4 @@ +from rest_framework import serializers from rest_framework.fields import SerializerMethodField from vbv_lernwelt.competence.serializers import ( @@ -6,6 +7,7 @@ from vbv_lernwelt.competence.serializers import ( from vbv_lernwelt.core.utils import get_django_content_type from vbv_lernwelt.course.serializer_helpers import get_course_serializer_class from vbv_lernwelt.learnpath.models import ( + CourseProfile, LearningContentAssignment, LearningContentEdoniqTest, LearningUnit, @@ -98,3 +100,9 @@ class LearningContentAssignmentSerializer( } except Exception: return None + + +class CourseProfileSerializer(serializers.ModelSerializer): + class Meta: + model = CourseProfile + fields = ["id", "code"]