From f09db20dda23c242792f97820a42bc968770aa06 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Wed, 2 Aug 2023 22:38:12 +0100 Subject: [PATCH] Fix certificate issues --- .../LockedCertificate.svelte | 18 +++----- .../UnlockedCertificate.svelte | 46 ++++++++----------- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/src/lib/components/Course/components/Ceritficate/StudentCertificate/LockedCertificate.svelte b/src/lib/components/Course/components/Ceritficate/StudentCertificate/LockedCertificate.svelte index 76f85894..3b3c2bee 100644 --- a/src/lib/components/Course/components/Ceritficate/StudentCertificate/LockedCertificate.svelte +++ b/src/lib/components/Course/components/Ceritficate/StudentCertificate/LockedCertificate.svelte @@ -1,20 +1,14 @@ -
+
- Certificate + Certificate

Certificates not available

- Your instructor needs to unlock your certificate.
If you need your certificate, - please contact your instructor. + Your instructor needs to unlock your certificate.
If you need your certificate, please contact + your instructor.

-
- - + diff --git a/src/lib/components/Course/components/Ceritficate/StudentCertificate/UnlockedCertificate.svelte b/src/lib/components/Course/components/Ceritficate/StudentCertificate/UnlockedCertificate.svelte index 9f33102e..98a2d251 100644 --- a/src/lib/components/Course/components/Ceritficate/StudentCertificate/UnlockedCertificate.svelte +++ b/src/lib/components/Course/components/Ceritficate/StudentCertificate/UnlockedCertificate.svelte @@ -3,29 +3,27 @@ import { currentOrg } from '$lib/utils/store/org'; import { profile } from '$lib/utils/store/user'; import PrimaryButton from '$lib/components/PrimaryButton/index.svelte'; + import Box from '$lib/components/Box/index.svelte'; let isLoading = false; const downLoadCertificate = async () => { isLoading = true; - const response = await fetch( - 'https://classroomio-server.fly.dev/downloadCertificate', - { - method: 'POST', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - theme: `${$course.certificate_theme}`, - studentName: `${$profile.fullname}`, - courseName: `${$course.title}`, - courseDescription: `${$course.description}`, - orgLogoUrl: `${$currentOrg.avatar_url}`, - orgName: `${$currentOrg.name}`, - }), - } - ); + const response = await fetch('https://classroomio-server.fly.dev/downloadCertificate', { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + theme: `${$course.certificate_theme}`, + studentName: `${$profile.fullname}`, + courseName: `${$course.title}`, + courseDescription: `${$course.description}`, + orgLogoUrl: `${$currentOrg.avatar_url}`, + orgName: `${$currentOrg.name}` + }) + }); const data = await response.blob(); console.log(data); const file = new Blob([data], { type: 'application/pdf' }); @@ -35,9 +33,9 @@ }; -
+
- Certificate + Certificate

Certificate is now available

-
- - +