From e093eddabcbc7336721fe9775c3cee0c4aa08bfd Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 31 Jan 2025 16:13:45 +0000 Subject: [PATCH] Update course slug --- src/components/SQLCourse/AccountButton.tsx | 6 +++--- src/components/SQLCourse/BuyButton.tsx | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/SQLCourse/AccountButton.tsx b/src/components/SQLCourse/AccountButton.tsx index 3eda765dd..cd76e3299 100644 --- a/src/components/SQLCourse/AccountButton.tsx +++ b/src/components/SQLCourse/AccountButton.tsx @@ -6,14 +6,14 @@ import { } from '../../queries/course-progress'; import { queryClient } from '../../stores/query-client'; import { CourseLoginPopup } from '../AuthenticationFlow/CourseLoginPopup'; -import { BuyButton, COURSE_SLUG } from './BuyButton'; +import { BuyButton, SQL_COURSE_SLUG } from './BuyButton'; export function AccountButton() { const [isVisible, setIsVisible] = useState(false); const [showLoginModal, setShowLoginModal] = useState(false); const { data: courseProgress, isLoading: isLoadingCourseProgress } = useQuery( - courseProgressOptions(COURSE_SLUG), + courseProgressOptions(SQL_COURSE_SLUG), queryClient, ); @@ -58,7 +58,7 @@ export function AccountButton() { return ( Start Learning diff --git a/src/components/SQLCourse/BuyButton.tsx b/src/components/SQLCourse/BuyButton.tsx index 8d989d8ae..9af3858e9 100644 --- a/src/components/SQLCourse/BuyButton.tsx +++ b/src/components/SQLCourse/BuyButton.tsx @@ -11,7 +11,7 @@ import { useToast } from '../../hooks/use-toast'; import { httpPost } from '../../lib/query-http'; import { deleteUrlParam, getUrlParams } from '../../lib/browser'; -export const COURSE_SLUG = 'master-sql'; +export const SQL_COURSE_SLUG = 'sql'; type CreateCheckoutSessionBody = { courseId: string; @@ -34,12 +34,12 @@ export function BuyButton(props: BuyButtonProps) { const toast = useToast(); const { data: coursePricing, isLoading: isLoadingCourse } = useQuery( - coursePriceOptions({ courseSlug: COURSE_SLUG }), + coursePriceOptions({ courseSlug: SQL_COURSE_SLUG }), queryClient, ); const { data: courseProgress, isLoading: isLoadingCourseProgress } = useQuery( - courseProgressOptions(COURSE_SLUG), + courseProgressOptions(SQL_COURSE_SLUG), queryClient, ); @@ -87,7 +87,7 @@ export function BuyButton(props: BuyButtonProps) { } createCheckoutSession({ - courseId: COURSE_SLUG, + courseId: SQL_COURSE_SLUG, success: `/courses/sql?e=1`, cancel: `/courses/sql`, }); @@ -101,7 +101,7 @@ export function BuyButton(props: BuyButtonProps) { const hasEnrolled = !!courseProgress?.enrolledAt; if (hasEnrolled) { - window.location.href = `${import.meta.env.PUBLIC_COURSE_APP_URL}/master-sql`; + window.location.href = `${import.meta.env.PUBLIC_COURSE_APP_URL}/${SQL_COURSE_SLUG}`; return; }