fix(build): payment-file route returns a Uint8Array body, not a Buffer (#1850)
The zero-extensions build (tsconfig.build.json) rejects a Node Buffer as a Response body (TS2345: Buffer<ArrayBufferLike> is not assignable to BodyInit), which has made every PR's Core Build red since #1845 merged. Main's push CI does not run that job, so it only surfaced on PRs. Same pattern as the PDF/XLSX report routes. Claude-Session: https://claude.ai/code/session_01ScVhg6XsDtNXkiEQNV7LaZ Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Jakob Wennberg
Claude Fable 5
parent
cef8206f83
commit
b41dbec098
@@ -218,7 +218,9 @@ export const GET = withRouteContext<{ params: Promise<{ period: string }> }>(
|
||||
.eq('id', agi.id)
|
||||
.eq('company_id', companyId)
|
||||
|
||||
return new Response(fileContent, {
|
||||
// Buffer is not assignable to BodyInit under the strict build tsconfig
|
||||
// (Buffer<ArrayBufferLike>); the repo convention is a Uint8Array view.
|
||||
return new Response(new Uint8Array(fileContent), {
|
||||
headers: {
|
||||
'Content-Type': contentType,
|
||||
'Content-Disposition': `attachment; filename="${filename}"`,
|
||||
|
||||
Reference in New Issue
Block a user