From b35ce9ab60824749904c962dd9d471867aa3e514 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Tue, 30 Jul 2024 17:18:22 +0600 Subject: [PATCH] fix: showcase roadmap index (#6283) --- src/api/roadmap.ts | 5 +++++ src/pages/r/[customRoadmapSlug].astro | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/api/roadmap.ts b/src/api/roadmap.ts index 2072a4fac..dab4e6fcb 100644 --- a/src/api/roadmap.ts +++ b/src/api/roadmap.ts @@ -30,5 +30,10 @@ export function roadmapApi(context: APIContext) { searchParams, ); }, + isShowcaseRoadmap: async function (slug: string) { + return api(context).get<{ + isShowcase: boolean; + }>(`${import.meta.env.PUBLIC_API_URL}/v1-is-showcase-roadmap/${slug}`); + }, }; } diff --git a/src/pages/r/[customRoadmapSlug].astro b/src/pages/r/[customRoadmapSlug].astro index e72b34c9f..5d133a578 100644 --- a/src/pages/r/[customRoadmapSlug].astro +++ b/src/pages/r/[customRoadmapSlug].astro @@ -4,13 +4,19 @@ import { CustomRoadmap } from '../../components/CustomRoadmap/CustomRoadmap'; import { SkeletonRoadmapHeader } from '../../components/CustomRoadmap/SkeletonRoadmapHeader'; import Loader from '../../components/Loader.astro'; import ProgressHelpPopup from '../../components/ProgressHelpPopup.astro'; +import { roadmapApi } from '../../api/roadmap'; export const prerender = false; const { customRoadmapSlug } = Astro.params; + +const roadmapClient = roadmapApi(Astro); +const { response, error } = await roadmapClient.isShowcaseRoadmap( + customRoadmapSlug!, +); --- - +