fix: undefined org name in student invite link + community error (#101)
* fix: move org slot media query to postcss * fix: remove slot css * fix: remove unused vars * fix: a ton of community improvements * chore: ci/cd supabase
This commit is contained in:
+10
-2
@@ -6,11 +6,19 @@
|
||||
export let onDelete = () => {};
|
||||
export let onCancel = () => {};
|
||||
export let open = false;
|
||||
export let isQuestion = false;
|
||||
</script>
|
||||
|
||||
<Modal onClose={() => (open = false)} bind:open width="w-96" modalHeading="Delete comment">
|
||||
<Modal
|
||||
onClose={() => (open = false)}
|
||||
bind:open
|
||||
width="w-96"
|
||||
modalHeading="Delete {isQuestion ? 'question' : 'comment'}"
|
||||
>
|
||||
<div>
|
||||
<h1 class="dark:text-white text-lg">Are you sure you want to delete this comment?</h1>
|
||||
<h1 class="dark:text-white text-lg">
|
||||
Are you sure you want to delete this {isQuestion ? 'question' : 'comment'}?
|
||||
</h1>
|
||||
|
||||
<div class="mt-5 flex items-center justify-between">
|
||||
<PrimaryButton
|
||||
@@ -1,4 +1,4 @@
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import AddCommentIcon from 'carbon-icons-svelte/lib/AddComment.svelte';
|
||||
import CommunityLoader from './Loader.svelte';
|
||||
@@ -15,10 +15,9 @@
|
||||
let isLoading = false;
|
||||
let discussions = [];
|
||||
|
||||
async function fetchCommunityQuestions(orgId) {
|
||||
async function fetchCommunityQuestions(orgId?: string) {
|
||||
if (!orgId) return;
|
||||
isLoading = true;
|
||||
|
||||
const { data, error } = await supabase
|
||||
.from('community_question')
|
||||
.select(
|
||||
@@ -29,12 +28,13 @@
|
||||
created_at,
|
||||
slug,
|
||||
comments:community_answer(count),
|
||||
author:organizationmember!community_question_author_id_fkey!inner(
|
||||
profile!inner(fullname)
|
||||
author:profile(
|
||||
fullname
|
||||
)
|
||||
`
|
||||
)
|
||||
.eq('organization_id', orgId);
|
||||
.eq('organization_id', orgId)
|
||||
.order('created_at', { ascending: false });
|
||||
console.log('data', data);
|
||||
console.log('error', error);
|
||||
isLoading = false;
|
||||
@@ -48,7 +48,7 @@
|
||||
data?.map((discussion) => ({
|
||||
title: discussion.title,
|
||||
slug: discussion.slug,
|
||||
author: discussion?.author?.profile?.fullname,
|
||||
author: discussion?.author?.fullname,
|
||||
comments: discussion.comments?.[0]?.count || 0,
|
||||
votes: discussion.votes,
|
||||
createdAt: calDateDiff(discussion.created_at)
|
||||
|
||||
Reference in New Issue
Block a user