feat: Puente Mayúscula-Minúscula + TTS SpeechSynthesis + E2E fixes

This commit is contained in:
renato97
2026-07-21 15:31:46 -03:00
commit fa8e0c58ce
120 changed files with 16013 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import { NextRequest, NextResponse } from "next/server"
import { prisma } from "@/lib/db"
export async function GET(request: NextRequest) {
const childId = request.nextUrl.searchParams.get("childId")
if (!childId) {
return NextResponse.json({ error: "childId required" }, { status: 400 })
}
const milestones = await prisma.milestone.findMany({
where: { childId },
orderBy: { reachedAt: "desc" },
})
return NextResponse.json(milestones)
}
export async function POST(request: Request) {
try {
const { childId, skillCode } = await request.json()
if (!childId || !skillCode) {
return NextResponse.json({ error: "childId and skillCode required" }, { status: 400 })
}
const existing = await prisma.milestone.findUnique({
where: { childId_skillCode: { childId, skillCode } },
})
if (existing) {
return NextResponse.json(existing)
}
const milestone = await prisma.milestone.create({
data: { childId, skillCode },
})
return NextResponse.json(milestone, { status: 201 })
} catch (error) {
console.error("Milestone error:", error)
return NextResponse.json({ error: "Internal error" }, { status: 500 })
}
}