CLASSROOMIO-T-152: Extra improvements
This commit is contained in:
@@ -42,7 +42,6 @@
|
|||||||
formatter = getCurrencyFormatter(currency);
|
formatter = getCurrencyFormatter(currency);
|
||||||
}
|
}
|
||||||
|
|
||||||
$: console.log('courseData.currency', courseData.currency);
|
|
||||||
$: setFormatter(courseData.currency);
|
$: setFormatter(courseData.currency);
|
||||||
$: discount = get(courseData, 'metadata.discount', 0);
|
$: discount = get(courseData, 'metadata.discount', 0);
|
||||||
$: calculatedCost = calcDisc(discount, courseData.cost || 0);
|
$: calculatedCost = calcDisc(discount, courseData.cost || 0);
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ export let landingPageSettings: Writable<OrgLandingPageJson> = writable({
|
|||||||
title: 'Our Story',
|
title: 'Our Story',
|
||||||
content:
|
content:
|
||||||
'Lorem ipsum dolor sit, amet consectetur adipisicing elit. Repudiandae, quaerat cum. Ullam similique quae dicta ipsum atque quam fugit iusto eligendi magni voluptatum aut, exercitationem deserunt vitae iste rem sunt!\nLorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores obcaecati veritatis tenetur in, nihil repellat quasi cumque sed molestias id reiciendis harum doloremque minus fugit quia cum dolores quas pariatur.',
|
'Lorem ipsum dolor sit, amet consectetur adipisicing elit. Repudiandae, quaerat cum. Ullam similique quae dicta ipsum atque quam fugit iusto eligendi magni voluptatum aut, exercitationem deserunt vitae iste rem sunt!\nLorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores obcaecati veritatis tenetur in, nihil repellat quasi cumque sed molestias id reiciendis harum doloremque minus fugit quia cum dolores quas pariatur.',
|
||||||
imageUrl: '',
|
imageUrl:
|
||||||
|
'https://koxqonvbkeakwvmdegcf.supabase.co/storage/v1/object/public/avatars/landingpage/riverside.jpeg',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
courses: {
|
courses: {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<input
|
<input
|
||||||
style="display:none"
|
style="display:none"
|
||||||
type="file"
|
type="file"
|
||||||
accept=".jpg, .jpeg, .png"
|
accept=".jpg, .jpeg, .png, .webp"
|
||||||
on:change={(e) => onFileSelected(e)}
|
on:change={(e) => onFileSelected(e)}
|
||||||
bind:this={fileinput}
|
bind:this={fileinput}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
>
|
>
|
||||||
<Editor {courseId} bind:course={courseData} />
|
<Editor {courseId} bind:course={courseData} />
|
||||||
<div class="rightBar">
|
<div class="rightBar">
|
||||||
<CourseLandingPage bind:courseData />
|
<CourseLandingPage bind:courseData editMode={true} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
import { SIGNUP_FIELDS } from '$lib/utils/constants/authentication';
|
import { SIGNUP_FIELDS } from '$lib/utils/constants/authentication';
|
||||||
import AuthUI from '$lib/components/AuthUI/index.svelte';
|
import AuthUI from '$lib/components/AuthUI/index.svelte';
|
||||||
import { profile } from '$lib/utils/store/user';
|
import { profile } from '$lib/utils/store/user';
|
||||||
|
import { currentOrg } from '$lib/utils/store/org';
|
||||||
|
|
||||||
let supabase = getSupabase();
|
let supabase = getSupabase();
|
||||||
let fields = Object.assign({}, SIGNUP_FIELDS);
|
let fields = Object.assign({}, SIGNUP_FIELDS);
|
||||||
@@ -53,7 +54,11 @@
|
|||||||
throw 'Error creating user';
|
throw 'Error creating user';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$currentOrg.id) return;
|
||||||
|
|
||||||
const [regexUsernameMatch] = [...(authUser.email?.matchAll(/(.*)@/g) || [])];
|
const [regexUsernameMatch] = [...(authUser.email?.matchAll(/(.*)@/g) || [])];
|
||||||
|
const response = await fetch('https://api.ipregistry.co/?key=tryout');
|
||||||
|
const metadata = await response.json();
|
||||||
|
|
||||||
const profileRes = await supabase
|
const profileRes = await supabase
|
||||||
.from('profile')
|
.from('profile')
|
||||||
@@ -61,7 +66,8 @@
|
|||||||
id: authUser.id,
|
id: authUser.id,
|
||||||
username: regexUsernameMatch[1] + `${new Date().getTime()}`,
|
username: regexUsernameMatch[1] + `${new Date().getTime()}`,
|
||||||
fullname: regexUsernameMatch[1],
|
fullname: regexUsernameMatch[1],
|
||||||
email: authUser.email
|
email: authUser.email,
|
||||||
|
metadata
|
||||||
})
|
})
|
||||||
.select();
|
.select();
|
||||||
console.log('profileRes', profileRes);
|
console.log('profileRes', profileRes);
|
||||||
@@ -77,12 +83,10 @@
|
|||||||
if (redirect) {
|
if (redirect) {
|
||||||
goto(redirect);
|
goto(redirect);
|
||||||
} else {
|
} else {
|
||||||
goto('/');
|
goto('/login');
|
||||||
}
|
}
|
||||||
|
|
||||||
formRef?.reset();
|
formRef?.reset();
|
||||||
|
|
||||||
// return goto('/login' + $page.url.search);
|
|
||||||
success = true;
|
success = true;
|
||||||
fields = Object.assign({}, SIGNUP_FIELDS);
|
fields = Object.assign({}, SIGNUP_FIELDS);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user