feat: implement DetailDialog component for PDF viewing and downloading; refactor API calls to use environment variables
This commit is contained in:
@@ -57,7 +57,7 @@ export function AddAsignaturaButton({ planId, onAdded }: { planId: string; onAdd
|
||||
if (!canIA) return
|
||||
setSaving(true)
|
||||
try {
|
||||
const res = await fetch("https://genesis-engine.apps.lci.ulsa.mx/api/generar/asignatura", {
|
||||
const res = await fetch(`${import.meta.env.VITE_BACK_ORIGIN}/api/generar/asignatura`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ planEstudiosId: planId, prompt: iaPrompt, semestre: iaSemestre.trim() ? Number(iaSemestre) : undefined, insert: true }),
|
||||
|
||||
@@ -14,7 +14,7 @@ export function AdjustAIButton({ plan }: { plan: PlanFull }) {
|
||||
|
||||
async function apply() {
|
||||
setLoading(true)
|
||||
await fetch('https://genesis-engine.apps.lci.ulsa.mx/api/mejorar/plan', {
|
||||
await fetch(`${import.meta.env.VITE_BACK_ORIGIN}/api/mejorar/plan`, {
|
||||
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ prompt, plan_id: plan.id }),
|
||||
}).catch(() => { })
|
||||
|
||||
Reference in New Issue
Block a user