diff --git a/src/api/ai-roadmap.ts b/src/api/ai-roadmap.ts new file mode 100644 index 000000000..944b120ed --- /dev/null +++ b/src/api/ai-roadmap.ts @@ -0,0 +1,20 @@ +import { type APIContext } from 'astro'; +import { api } from './api.ts'; + +export type GetAIRoadmapBySlugResponse = { + id: string; + term: string; + title: string; + data: string; + isAuthenticatedUser: boolean; +}; + +export function aiRoadmapApi(context: APIContext) { + return { + getAIRoadmapBySlug: async function (roadmapSlug: string) { + return api(context).get( + `${import.meta.env.PUBLIC_API_URL}/v1-get-ai-roadmap-by-slug/${roadmapSlug}`, + ); + }, + }; +} diff --git a/src/components/ExploreAIRoadmap/AIRoadmapsList.tsx b/src/components/ExploreAIRoadmap/AIRoadmapsList.tsx index 9f65ff18b..7129410e6 100644 --- a/src/components/ExploreAIRoadmap/AIRoadmapsList.tsx +++ b/src/components/ExploreAIRoadmap/AIRoadmapsList.tsx @@ -26,7 +26,8 @@ export function AIRoadmapsList(props: AIRoadmapsListProps) { return (