Merge branch 'fix/ai-roadmap' of github.com:kamranahmedse/developer-roadmap into fix/ai-roadmap

fix/ai-roadmap
Kamran Ahmed 9 months ago
commit 3daab9fbe6
  1. 2
      src/components/ExploreAIRoadmap/ExploreAIRoadmap.tsx
  2. 8
      src/components/GenerateRoadmap/GenerateRoadmap.tsx

@ -40,7 +40,7 @@ export function ExploreAIRoadmap() {
const loadAIRoadamps = useCallback(
async (currPage: number) => {
const { response, error } = await httpGet<ExploreRoadmapsResponse>(
`${import.meta.env.PUBLIC_API_URL}/v1-explore-roadmaps`,
`${import.meta.env.PUBLIC_API_URL}/v1-list-ai-roadmaps`,
{
currPage,
},

@ -176,7 +176,7 @@ export function GenerateRoadmap() {
setIsLoading(false);
};
const addToCustomRoadmap = async () => {
const saveAIRoadmap = async () => {
if (!isLoggedIn()) {
showLoginPopup();
return;
@ -189,7 +189,7 @@ export function GenerateRoadmap() {
const { response, error } = await httpPost<{
roadmapId: string;
}>(
`${import.meta.env.PUBLIC_API_URL}/v1-edit-ai-generated-roadmap/${currentRoadmap?.id}`,
`${import.meta.env.PUBLIC_API_URL}/v1-save-ai-roadmap/${currentRoadmap?.id}`,
{
title: roadmapTopic,
nodes: nodes.map((node) => ({
@ -468,7 +468,7 @@ export function GenerateRoadmap() {
<button
className="inline-flex items-center justify-center gap-2 rounded-md bg-gray-200 py-1.5 pl-2.5 pr-3 text-xs font-medium text-black transition-colors duration-300 hover:bg-gray-300 sm:text-sm"
onClick={async () => {
const roadmapId = await addToCustomRoadmap();
const roadmapId = await saveAIRoadmap();
if (roadmapId) {
window.location.href = `/r?id=${roadmapId}`;
}
@ -482,7 +482,7 @@ export function GenerateRoadmap() {
<button
className="inline-flex items-center justify-center gap-2 rounded-md bg-gray-200 py-1.5 pl-2.5 pr-3 text-xs font-medium text-black transition-colors duration-300 hover:bg-gray-300 sm:text-sm"
onClick={async () => {
const roadmapId = await addToCustomRoadmap();
const roadmapId = await saveAIRoadmap();
if (roadmapId) {
window.open(
`${import.meta.env.PUBLIC_EDITOR_APP_URL}/${roadmapId}`,

Loading…
Cancel
Save