first commit
Some checks failed
Deploy Production / deploy (push) Has been cancelled

This commit is contained in:
Frank John Begornia
2026-01-12 22:16:36 +08:00
commit 3ba0b250ed
44 changed files with 18635 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
export default defineEventHandler(async (event) => {
const params = event.context.params as { designId?: string }
const designId = params?.designId
if (!designId) {
throw createError({ statusCode: 400, statusMessage: "Missing design id" })
}
const config = useRuntimeConfig()
const backendUrl = config.public?.backendUrl
if (!backendUrl) {
throw createError({ statusCode: 500, statusMessage: "Backend URL not configured" })
}
try {
const design = await $fetch(`/designs/${encodeURIComponent(designId)}`, {
baseURL: backendUrl,
method: "GET",
})
return design
} catch (err) {
console.error(`[designs] Failed to fetch design ${designId}`, err)
throw createError({
statusCode: 502,
statusMessage: (err as Error)?.message ?? "Failed to load design",
})
}
})