* wip: implement success modal * feat: share solution modal * fix: step count issue * fix: responsiveness share button * feat: project listing * wip * wip: project status * feat: personal dashboard * wip: team activity * feat: personal dashboard page * feat: add team member tooltip * feat: dashboard favourite * fix: invite team page * fix: invite team * wip: update design * fix: add custom roadmaps * feat: add projects in public page * wip: dashboard re-design * feat: add teams * feat: update dashboard design * feat: update dashboard design * feat: add streak stats * feat: add topics done today count * UI changes for dashboard * Refactor progress stack * Progress stack UI * Progress stack card fixes * Update card designs * AI and custom roadmap * Update recommendation * Update recommendation UI * Add AI roadmap listing * Redirect to team page from dashboard --------- Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
74 lines
2.4 KiB
TypeScript
74 lines
2.4 KiB
TypeScript
import { getAllBestPractices } from '../lib/best-practice';
|
|
import { getAllGuides } from '../lib/guide';
|
|
import { getRoadmapsByTag } from '../lib/roadmap';
|
|
import { getAllVideos } from '../lib/video';
|
|
import { getAllQuestionGroups } from '../lib/question-group';
|
|
import { getAllProjects } from '../lib/project';
|
|
|
|
export async function GET() {
|
|
const guides = await getAllGuides();
|
|
const videos = await getAllVideos();
|
|
const questionGroups = await getAllQuestionGroups();
|
|
const roadmaps = await getRoadmapsByTag('roadmap');
|
|
const bestPractices = await getAllBestPractices();
|
|
const projects = await getAllProjects();
|
|
|
|
return new Response(
|
|
JSON.stringify([
|
|
...roadmaps.map((roadmap) => ({
|
|
id: roadmap.id,
|
|
url: `/${roadmap.id}`,
|
|
title: roadmap.frontmatter.briefTitle,
|
|
description: roadmap.frontmatter.briefDescription,
|
|
group: 'Roadmaps',
|
|
metadata: {
|
|
tags: roadmap.frontmatter.tags,
|
|
},
|
|
renderer: roadmap?.frontmatter?.renderer || 'balsamiq',
|
|
})),
|
|
...bestPractices.map((bestPractice) => ({
|
|
id: bestPractice.id,
|
|
url: `/best-practices/${bestPractice.id}`,
|
|
title: bestPractice.frontmatter.briefTitle,
|
|
description: bestPractice.frontmatter.briefDescription,
|
|
group: 'Best Practices',
|
|
})),
|
|
...questionGroups.map((questionGroup) => ({
|
|
id: questionGroup.id,
|
|
url: `/questions/${questionGroup.id}`,
|
|
title: questionGroup.frontmatter.briefTitle,
|
|
group: 'Questions',
|
|
})),
|
|
...guides.map((guide) => ({
|
|
id: guide.id,
|
|
url: guide.frontmatter.excludedBySlug
|
|
? guide.frontmatter.excludedBySlug
|
|
: `/guides/${guide.id}`,
|
|
title: guide.frontmatter.title,
|
|
description: guide.frontmatter.description,
|
|
authorId: guide.frontmatter.authorId,
|
|
group: 'Guides',
|
|
})),
|
|
...videos.map((video) => ({
|
|
id: video.id,
|
|
url: `/videos/${video.id}`,
|
|
title: video.frontmatter.title,
|
|
group: 'Videos',
|
|
})),
|
|
...projects.map((project) => ({
|
|
id: project.id,
|
|
url: `/projects/${project.id}`,
|
|
title: project.frontmatter.title,
|
|
description: project.frontmatter.description,
|
|
group: 'Projects',
|
|
})),
|
|
]),
|
|
{
|
|
status: 200,
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
},
|
|
);
|
|
}
|