course slug improvement
This commit is contained in:
@@ -40,7 +40,6 @@ Note: Make sure you are using Node 18
|
|||||||
PUBLIC_SUPABASE_ANON_KEY=
|
PUBLIC_SUPABASE_ANON_KEY=
|
||||||
PUBLIC_SUPABASE_URL=
|
PUBLIC_SUPABASE_URL=
|
||||||
NETLIFY_API_KEY=
|
NETLIFY_API_KEY=
|
||||||
MIXPANEL_TOKEN=
|
|
||||||
OPENAI_API_KEY=
|
OPENAI_API_KEY=
|
||||||
CLOUDFLARE_TOKEN_VALUE=
|
CLOUDFLARE_TOKEN_VALUE=
|
||||||
CLOUDFLARE_ACCESS_KEY=
|
CLOUDFLARE_ACCESS_KEY=
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
function generateSlug(title) {
|
function generateSlug(title) {
|
||||||
return title
|
return title
|
||||||
.match(/[^\W\s\d]*/g, '')
|
.match(/[^\W\s\d]*/g, '')
|
||||||
.join('')
|
.join('-')
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.concat(`-${new Date().getTime()}`);
|
.concat(`-${new Date().getTime()}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ import type {
|
|||||||
import { STATUS } from '$lib/utils/constants/course';
|
import { STATUS } from '$lib/utils/constants/course';
|
||||||
import type { PostgrestSingleResponse } from '@supabase/supabase-js';
|
import type { PostgrestSingleResponse } from '@supabase/supabase-js';
|
||||||
|
|
||||||
import htmlElements from '$lib/mocks/html/001_html_elements';
|
|
||||||
|
|
||||||
export async function fetchCourse(courseId?: Course['id'], slug?: Course['slug']) {
|
export async function fetchCourse(courseId?: Course['id'], slug?: Course['slug']) {
|
||||||
let match: { slug?: string; id?: string; status?: string } = {};
|
let match: { slug?: string; id?: string; status?: string } = {};
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,8 @@
|
|||||||
note: lessonData.note,
|
note: lessonData.note,
|
||||||
slide_url: lessonData.slide_url
|
slide_url: lessonData.slide_url
|
||||||
},
|
},
|
||||||
lesson_completion
|
lesson_completion,
|
||||||
|
exercises: []
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,7 +205,7 @@
|
|||||||
mode = mode === MODES.edit ? MODES.view : MODES.edit;
|
mode = mode === MODES.edit ? MODES.view : MODES.edit;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleAppClick(appName) {
|
function handleAppClick(appName: string) {
|
||||||
$apps.selectedApp = appName;
|
$apps.selectedApp = appName;
|
||||||
$apps.open = true;
|
$apps.open = true;
|
||||||
}
|
}
|
||||||
@@ -232,7 +233,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Exercises',
|
label: 'Exercises',
|
||||||
badgeValue: $lesson.exercises.length,
|
badgeValue: data.isMaterialsTabActive ? $lesson.totalExercises : $lesson.exercises.length,
|
||||||
isActive: !data.isMaterialsTabActive,
|
isActive: !data.isMaterialsTabActive,
|
||||||
href: `${path}/exercises`
|
href: `${path}/exercises`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user