Fix add course issues

This commit is contained in:
rotimi-best
2021-08-24 20:26:16 +03:00
parent b0baf5915c
commit eb70f7f40f
3 changed files with 14 additions and 9 deletions
+2 -2
View File
@@ -16,7 +16,7 @@
/> -->
</h4>
<p>{courseData.description}</p>
<div class="flex mt-3 mb-2">
<!-- <div class="flex mt-3 mb-2">
<span class="flex mr-2"
><Education16 class="mr-2" />
5</span
@@ -25,7 +25,7 @@
><Catalog16 class="mr-2" />
20</span
>
</div>
</div> -->
</div>
{/each}
</div>
+11 -6
View File
@@ -30,11 +30,11 @@
import { validateForm } from '../components/Courses/functions';
import { ROLE } from '../utils/constants/roles';
import { addGroupMember } from '../utils/services/courses';
import { supabase } from '../utils/functions/supabase';
// const { page } = stores();
export let allCourses;
export let organizationId;
export let allCourses = [];
export let cantFetch;
let errors = {
@@ -64,13 +64,15 @@
title,
description,
group_id,
// organization_id: organizationId,
});
console.log(`newCourse`, newCourse);
courses.update((_courses) => [..._courses, newCourse[0]]);
// Get profile of author and add as member
const admin = await addGroupMember({
await addGroupMember({
profile_id: $profile.id,
email: student,
email: $profile.email,
group_id,
role_id: ROLE.TUTOR,
});
@@ -96,6 +98,7 @@
addGroupMember(membersStack).then((membersAdded) => {
console.log(`membersAdded`, membersAdded);
$createCourseModal.open = false;
});
}
@@ -106,7 +109,9 @@
const coursesResult = await fetchCourses(userId);
console.log(`coursesResult`, coursesResult);
organizationId = coursesResult.organizationId;
if (!coursesResult) return;
// organizationId = coursesResult.organizationId;
courses.set(coursesResult.allCourses);
}
}
+1 -1
View File
@@ -78,7 +78,7 @@
<div class="h-40 text-md flex items-center justify-center flex-col">
<p class="">
A link has been sent to your email. Please check both your
<strong>spam</strong>and your<strong>inbox</strong>.
<strong>spam </strong>and your<strong> inbox</strong>.
</p>
<p class="mt-2 underline">
If our email is in your spam, do make sure you mark our email