chore: update naming

fix/ai-roadmap
Arik Chakma 9 months ago
parent 728bbea170
commit c01fed4f18
  1. 2
      src/components/ExploreAIRoadmap/ExploreAIRoadmap.tsx
  2. 8
      src/components/GenerateRoadmap/GenerateRoadmap.tsx

@ -40,7 +40,7 @@ export function ExploreAIRoadmap() {
const loadAIRoadamps = useCallback( const loadAIRoadamps = useCallback(
async (currPage: number) => { async (currPage: number) => {
const { response, error } = await httpGet<ExploreRoadmapsResponse>( 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, currPage,
}, },

@ -176,7 +176,7 @@ export function GenerateRoadmap() {
setIsLoading(false); setIsLoading(false);
}; };
const addToCustomRoadmap = async () => { const saveAIRoadmap = async () => {
if (!isLoggedIn()) { if (!isLoggedIn()) {
showLoginPopup(); showLoginPopup();
return; return;
@ -189,7 +189,7 @@ export function GenerateRoadmap() {
const { response, error } = await httpPost<{ const { response, error } = await httpPost<{
roadmapId: string; 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, title: roadmapTopic,
nodes: nodes.map((node) => ({ nodes: nodes.map((node) => ({
@ -468,7 +468,7 @@ export function GenerateRoadmap() {
<button <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" 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 () => { onClick={async () => {
const roadmapId = await addToCustomRoadmap(); const roadmapId = await saveAIRoadmap();
if (roadmapId) { if (roadmapId) {
window.location.href = `/r?id=${roadmapId}`; window.location.href = `/r?id=${roadmapId}`;
} }
@ -482,7 +482,7 @@ export function GenerateRoadmap() {
<button <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" 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 () => { onClick={async () => {
const roadmapId = await addToCustomRoadmap(); const roadmapId = await saveAIRoadmap();
if (roadmapId) { if (roadmapId) {
window.open( window.open(
`${import.meta.env.PUBLIC_EDITOR_APP_URL}/${roadmapId}`, `${import.meta.env.PUBLIC_EDITOR_APP_URL}/${roadmapId}`,

Loading…
Cancel
Save