mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-03 06:12:53 +02:00
@@ -52,7 +52,10 @@ 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 courses = roadmapData.courses || [];
|
||||
const question = roadmapData?.questions?.find(
|
||||
(question) => question.type === 'main',
|
||||
);
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
|
@@ -72,33 +72,24 @@ export interface OfficialRoadmapDocument {
|
||||
|
||||
questions?: OfficialRoadmapQuestion[];
|
||||
relatedRoadmaps?: string[];
|
||||
courses?: string[];
|
||||
courses?: OfficialRoadmapCourse[];
|
||||
|
||||
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<OfficialRoadmapWithCourses>(
|
||||
`/v1-official-roadmap/${slug}`,
|
||||
);
|
||||
return httpGet<OfficialRoadmapDocument>(`/v1-official-roadmap/${slug}`);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function officialRoadmapDetails(roadmapSlug: string) {
|
||||
try {
|
||||
const roadmap = await httpGet<OfficialRoadmapWithCourses>(
|
||||
const roadmap = await httpGet<OfficialRoadmapDocument>(
|
||||
`/v1-official-roadmap/${roadmapSlug}`,
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user