chore: remove unused code

This commit is contained in:
Rotimi Best
2023-12-13 14:47:05 +03:00
parent 0c33dd9159
commit 4851523b84
2 changed files with 3 additions and 9 deletions
@@ -1,6 +1,5 @@
export const load = ({ params = { slug: '' } }) => {
export const load = () => {
return {
allCourses: [],
cantFetch: true
};
};
@@ -1,5 +1,4 @@
<script lang="ts">
import { onMount } from 'svelte';
import { Search, Dropdown } from 'carbon-components-svelte';
import { page } from '$app/stores';
import { profile } from '$lib/utils/store/user';
@@ -16,7 +15,7 @@
import { browser } from '$app/environment';
export let data;
let { allCourses, cantFetch } = data;
let { cantFetch } = data;
let searchValue = '';
let selectedId: string;
let filteredCourses: Course[];
@@ -29,7 +28,7 @@
}
async function getCourses(userId: string | null, orgId: string) {
if (cantFetch && typeof cantFetch === 'boolean' && !allCourses.length && orgId && !hasFetched) {
if (cantFetch && typeof cantFetch === 'boolean' && orgId && !hasFetched) {
// only show is loading when fetching for the first time
if (!$courses.length) {
$courseMetaDeta.isLoading = true;
@@ -75,10 +74,6 @@
}
}
onMount(() => {
courses.set(allCourses);
});
$: filterCourses(searchValue, selectedId, $courses);
$: getCourses($profile.id, $currentOrg.id);
</script>