fix: cockpit url base

This commit is contained in:
Reto Aebersold 2023-12-18 12:25:19 +01:00
parent c769247146
commit 9e31975d76
1 changed files with 5 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import {
useCourseSessionDetailQuery,
} from "@/composables";
import { circleFlatLearningContents } from "@/services/circle";
import { getCockpitUrl } from "@/utils/utils";
interface Submittable {
id: string;
@ -126,10 +127,12 @@ const getShowDetailsText = (lc: LearningContent) => {
};
const getDetailsLink = (lc: LearningContent, circleId: string) => {
const base = getCockpitUrl(props.courseSession.course.slug);
if (isFeedback(lc)) {
return `cockpit/feedback/${circleId}`;
return `${base}/feedback/${circleId}`;
} else if (isAssignment(lc) || isEdoniqTest(lc)) {
return `cockpit/assignment/${lc.id}`;
return `${base}/assignment/${lc.id}`;
}
return "";
};