feat: custom fields improvements
This commit is contained in:
parent
9495b54a28
commit
0f0f367b3a
11 changed files with 1290 additions and 12 deletions
|
|
@ -147,8 +147,9 @@ export async function GET(
|
|||
},
|
||||
})
|
||||
const bytes = pdfBuffer instanceof Uint8Array ? pdfBuffer : new Uint8Array(pdfBuffer)
|
||||
const arrayBuffer = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)
|
||||
const filename = slugifyFilename(detail.dashboard.name ?? "dashboard", "pdf")
|
||||
return new NextResponse(bytes, {
|
||||
return new NextResponse(arrayBuffer, {
|
||||
status: 200,
|
||||
headers: {
|
||||
"Content-Type": "application/pdf",
|
||||
|
|
@ -160,8 +161,9 @@ export async function GET(
|
|||
|
||||
const screenshot = await page.screenshot({ type: "png", fullPage: true })
|
||||
const bytes = screenshot instanceof Uint8Array ? screenshot : new Uint8Array(screenshot)
|
||||
const arrayBuffer = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)
|
||||
const filename = slugifyFilename(detail.dashboard.name ?? "dashboard", "png")
|
||||
return new NextResponse(bytes, {
|
||||
return new NextResponse(arrayBuffer, {
|
||||
status: 200,
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue