diff --git a/src/components/course/course-card.astro b/src/components/course/course-card.astro
index 8b313fd..d1d75f7 100644
--- a/src/components/course/course-card.astro
+++ b/src/components/course/course-card.astro
@@ -16,10 +16,10 @@ const tier_one = getPrices('price_tier_one',import.meta.env.ASTRO_CURRENCY.toLow
diff --git a/src/components/course/course-hero.astro b/src/components/course/course-hero.astro
index 046129d..20af0fe 100644
--- a/src/components/course/course-hero.astro
+++ b/src/components/course/course-hero.astro
@@ -19,12 +19,12 @@ const { course }: Props = Astro.props;
- {course?.image && (
+ {course.user_created.avatar && (
diff --git a/src/components/course/course-reviews.astro b/src/components/course/course-reviews.astro
index ffe21c9..fe82e89 100644
--- a/src/components/course/course-reviews.astro
+++ b/src/components/course/course-reviews.astro
@@ -71,10 +71,10 @@ const getOverallRating = (reviews: any) => {
diff --git a/src/components/post/post-card-column.astro b/src/components/post/post-card-column.astro
index b4c9cf8..36dfde2 100644
--- a/src/components/post/post-card-column.astro
+++ b/src/components/post/post-card-column.astro
@@ -11,8 +11,8 @@ const { post }: Props = Astro.props;
diff --git a/src/components/post/post-card-row.astro b/src/components/post/post-card-row.astro
index f1fad6f..b4f8935 100644
--- a/src/components/post/post-card-row.astro
+++ b/src/components/post/post-card-row.astro
@@ -12,8 +12,8 @@ const { post }: Props = Astro.props;
diff --git a/src/libs/courses.ts b/src/libs/courses.ts
index 8875efb..110698a 100644
--- a/src/libs/courses.ts
+++ b/src/libs/courses.ts
@@ -2,10 +2,20 @@ import directus from "./directus";
import { readItems, type Query } from "@directus/sdk";
import type { CodyopsCourses, Courses } from "../types/codyops-courses";
+const isDev = import.meta.env.DEV; // Astro's way to check for development mode
+
export const courses = await directus.request(
readItems>("codyops_courses", {
fields: [
- '*',
+ 'id',
+ 'name',
+ 'level',
+ 'category',
+ 'cloud',
+ 'image',
+ 'description',
+ 'features',
+ 'status',
{
codyops_careers: [
{
@@ -32,7 +42,11 @@ export const courses = await directus.request(
'video'
]
}
- ]}
+ ],
+ filter: {
+ status: isDev ? { '_neq': 'archived' } : { '_eq': 'published' }
+ },
+ }
)
);
diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro
index 398d584..8ce7cac 100644
--- a/src/pages/blog/[slug].astro
+++ b/src/pages/blog/[slug].astro
@@ -26,8 +26,8 @@ const { post } = Astro.props;
{post.title}