chore: add roadmap slug (#5568)

pull/5569/head
Arik Chakma 7 months ago committed by GitHub
parent 961d398b8d
commit 33c318fbda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      src/components/GenerateRoadmap/GenerateRoadmap.tsx

@ -263,6 +263,7 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
const { response, error } = await httpPost<{ const { response, error } = await httpPost<{
roadmapId: string; roadmapId: string;
roadmapSlug: string;
}>( }>(
`${import.meta.env.PUBLIC_API_URL}/v1-save-ai-roadmap/${currentRoadmap?.id}`, `${import.meta.env.PUBLIC_API_URL}/v1-save-ai-roadmap/${currentRoadmap?.id}`,
{ {
@ -293,7 +294,7 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
setIsLoading(false); setIsLoading(false);
pageProgressMessage.set(''); pageProgressMessage.set('');
return response.roadmapId; return response.roadmapSlug;
}; };
const downloadGeneratedRoadmapContent = async () => { const downloadGeneratedRoadmapContent = async () => {
@ -685,9 +686,9 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
<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 saveAIRoadmap(); const roadmapSlug = await saveAIRoadmap();
if (roadmapId) { if (roadmapSlug) {
window.location.href = `/r?id=${roadmapId}`; window.location.href = `/r/${roadmapSlug}`;
} }
}} }}
disabled={isLoading} disabled={isLoading}

Loading…
Cancel
Save