fix: fix bugs

This commit is contained in:
swve 2023-01-29 19:09:03 +01:00
parent 02a5ed6354
commit e47a9939b5
3 changed files with 4 additions and 3 deletions

View file

@ -26,7 +26,8 @@ function LecturePage(params: any) {
async function markLectureAsCompleteFront() { async function markLectureAsCompleteFront() {
const activity = await maskLectureAsComplete("" + lectureid, courseid, lecture.lecture_id.replace("lecture_", "")); const activity = await maskLectureAsComplete("" + lectureid, courseid, lecture.lecture_id.replace("lecture_", ""));
mutate(`${getAPIUrl()}courses/meta/${courseid}`); mutate(`${getAPIUrl()}lectures/lecture_${lectureid}`);
mutate(`${getAPIUrl()}courses/meta/course_${courseid}`);
} }
return ( return (

View file

@ -20,7 +20,7 @@ export const Menu = (params : any) => {
<LogoArea> <LogoArea>
<Logo> <Logo>
<Image width={25} height={25} src={learnhouseIcon} alt="" /> <Image width={25} height={25} src={learnhouseIcon} alt="" />
<Link href={"/"}> <Link href={getUriWithOrg(orgslug, "/")}>
<Image width={108} height={28} src={learnhouseLogo} alt="" /> <Image width={108} height={28} src={learnhouseLogo} alt="" />
</Link> </Link>
</Logo> </Logo>

View file

@ -10,6 +10,6 @@ export const getUriWithOrg = ( orgslug: string, path: string) => {
}; };
export const getOrgFromUri = (uri: any) => { export const getOrgFromUri = (uri: any) => {
let org = uri.match(/\/org\/(.*?)\//)[1]; let org = uri.match(/\/org\/([\w]+)/)[1];
return org; return org;
}; };