mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-09 16:53:33 +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 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 projects = await getProjectsByRoadmapId(roadmapId);
|
||||||
const courses = roadmapData?.courses || [];
|
const courses = roadmapData.courses || [];
|
||||||
|
const question = roadmapData?.questions?.find(
|
||||||
|
(question) => question.type === 'main',
|
||||||
|
);
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout
|
<BaseLayout
|
||||||
|
@@ -72,33 +72,24 @@ export interface OfficialRoadmapDocument {
|
|||||||
|
|
||||||
questions?: OfficialRoadmapQuestion[];
|
questions?: OfficialRoadmapQuestion[];
|
||||||
relatedRoadmaps?: string[];
|
relatedRoadmaps?: string[];
|
||||||
courses?: string[];
|
courses?: OfficialRoadmapCourse[];
|
||||||
|
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OfficialRoadmapWithCourses = Omit<
|
|
||||||
OfficialRoadmapDocument,
|
|
||||||
'courses'
|
|
||||||
> & {
|
|
||||||
courses: OfficialRoadmapCourse[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export function officialRoadmapOptions(slug: string) {
|
export function officialRoadmapOptions(slug: string) {
|
||||||
return queryOptions({
|
return queryOptions({
|
||||||
queryKey: ['official-roadmap', slug],
|
queryKey: ['official-roadmap', slug],
|
||||||
queryFn: () => {
|
queryFn: () => {
|
||||||
return httpGet<OfficialRoadmapWithCourses>(
|
return httpGet<OfficialRoadmapDocument>(`/v1-official-roadmap/${slug}`);
|
||||||
`/v1-official-roadmap/${slug}`,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function officialRoadmapDetails(roadmapSlug: string) {
|
export async function officialRoadmapDetails(roadmapSlug: string) {
|
||||||
try {
|
try {
|
||||||
const roadmap = await httpGet<OfficialRoadmapWithCourses>(
|
const roadmap = await httpGet<OfficialRoadmapDocument>(
|
||||||
`/v1-official-roadmap/${roadmapSlug}`,
|
`/v1-official-roadmap/${roadmapSlug}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user