mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-09 16:53:33 +02:00
feat: roadmap with courses
This commit is contained in:
committed by
Kamran Ahmed
parent
40c7ea1b43
commit
4e569df2a3
@@ -52,10 +52,7 @@ const nounTitle =
|
||||
const seoDescription = `Seeking ${nounTitle.toLowerCase()} courses to enhance your skills? Explore our top free and paid courses to help you become a ${nounTitle} expert!`;
|
||||
|
||||
const projects = await getProjectsByRoadmapId(roadmapId);
|
||||
const courses = roadmapData.courses || [];
|
||||
const question = roadmapData?.questions?.find(
|
||||
(question) => question.type === 'main',
|
||||
);
|
||||
const courses = roadmapData?.courses || [];
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
|
@@ -72,24 +72,33 @@ export interface OfficialRoadmapDocument {
|
||||
|
||||
questions?: OfficialRoadmapQuestion[];
|
||||
relatedRoadmaps?: string[];
|
||||
courses?: OfficialRoadmapCourse[];
|
||||
courses?: string[];
|
||||
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export type OfficialRoadmapWithCourses = Omit<
|
||||
OfficialRoadmapDocument,
|
||||
'courses'
|
||||
> & {
|
||||
courses: OfficialRoadmapCourse[];
|
||||
};
|
||||
|
||||
export function officialRoadmapOptions(slug: string) {
|
||||
return queryOptions({
|
||||
queryKey: ['official-roadmap', slug],
|
||||
queryFn: () => {
|
||||
return httpGet<OfficialRoadmapDocument>(`/v1-official-roadmap/${slug}`);
|
||||
return httpGet<OfficialRoadmapWithCourses>(
|
||||
`/v1-official-roadmap/${slug}`,
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function officialRoadmapDetails(roadmapSlug: string) {
|
||||
try {
|
||||
const roadmap = await httpGet<OfficialRoadmapDocument>(
|
||||
const roadmap = await httpGet<OfficialRoadmapWithCourses>(
|
||||
`/v1-official-roadmap/${roadmapSlug}`,
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user