From 49dc34a660d939ad6dbf4a5cf5d2eca7f89e01be Mon Sep 17 00:00:00 2001 From: emmanuel Date: Sat, 15 Jul 2023 18:46:13 +0000 Subject: [PATCH] CLASSROOMIO-T-63: fixed the bug on create course using the query param CLASSROOMIO-T-63:fixed pretttier config and saved CLASSROOMIO-T-63:fixed prettier config CLASSROOMIO-T-63:Fixed the create course function CLASSROOMIO-T-63:updated the create course function FIX:CLASROOMIO-T-63([BUG]On Create course click on dashboard){fixed the bug using the query parameter Co-authored-by: Ifeanyi Nwosu Co-authored-by: emmanuel Merge-request: CLASSROOMIO-MR-17 Merged-by: Best Admin --- src/routes/org/[slug]/courses.svelte | 9 ++++++++- src/routes/org/[slug]/index.svelte | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/routes/org/[slug]/courses.svelte b/src/routes/org/[slug]/courses.svelte index 444beb6a..47f8045a 100644 --- a/src/routes/org/[slug]/courses.svelte +++ b/src/routes/org/[slug]/courses.svelte @@ -4,12 +4,15 @@ export async function preload(page, params) { const parsedUser = JSON.parse(params.user); - + // if (page.query.create === 'true') { + // $createCourseModal.open = true; + // } // if (parsedUser && parsedUser.id) { // return fetchCourses(parsedUser.id); // } return { + page, allCourses: [], organizationId: null, cantFetch: true, @@ -31,7 +34,11 @@ export let allCourses = []; export let cantFetch; + export let page; + if (page.query.create === 'true') { + $createCourseModal.open = true; + } async function getCourses(userId) { if (process.browser) { if (cantFetch && typeof cantFetch === 'boolean' && !allCourses.length) { diff --git a/src/routes/org/[slug]/index.svelte b/src/routes/org/[slug]/index.svelte index bfe649fa..c599ee7e 100644 --- a/src/routes/org/[slug]/index.svelte +++ b/src/routes/org/[slug]/index.svelte @@ -15,7 +15,6 @@ import { onMount } from 'svelte'; import { InlineCalendar, Datepicker } from 'svelte-calendar'; import CheckmarkFilled20 from 'carbon-icons-svelte/lib/CheckmarkFilled20'; - import { formatUserUpcomingData, formatDate,