fix: showcase roadmap index

fix/index
Arik Chakma 4 months ago
parent bff7c4203a
commit 68c944f777
  1. 5
      src/api/roadmap.ts
  2. 8
      src/pages/r/[customRoadmapSlug].astro

@ -30,5 +30,10 @@ export function roadmapApi(context: APIContext) {
searchParams, searchParams,
); );
}, },
isShowcaseRoadmap: async function (slug: string) {
return api(context).get<{
isShowcase: boolean;
}>(`${import.meta.env.PUBLIC_API_URL}/v1-is-showcase-roadmap/${slug}`);
},
}; };
} }

@ -4,13 +4,19 @@ import { CustomRoadmap } from '../../components/CustomRoadmap/CustomRoadmap';
import { SkeletonRoadmapHeader } from '../../components/CustomRoadmap/SkeletonRoadmapHeader'; import { SkeletonRoadmapHeader } from '../../components/CustomRoadmap/SkeletonRoadmapHeader';
import Loader from '../../components/Loader.astro'; import Loader from '../../components/Loader.astro';
import ProgressHelpPopup from '../../components/ProgressHelpPopup.astro'; import ProgressHelpPopup from '../../components/ProgressHelpPopup.astro';
import { roadmapApi } from '../../api/roadmap';
export const prerender = false; export const prerender = false;
const { customRoadmapSlug } = Astro.params; const { customRoadmapSlug } = Astro.params;
const roadmapClient = roadmapApi(Astro);
const { response, error } = await roadmapClient.isShowcaseRoadmap(
customRoadmapSlug!,
);
--- ---
<BaseLayout title='Roadmaps'> <BaseLayout title='Roadmaps' noIndex={!response?.isShowcase}>
<ProgressHelpPopup /> <ProgressHelpPopup />
<div> <div>
<div class='flex min-h-[550px] flex-col'> <div class='flex min-h-[550px] flex-col'>

Loading…
Cancel
Save