diff --git a/apps/pay/src/receipt.ts b/apps/pay/src/receipt.ts index 0d7ac3f..ee1defe 100644 --- a/apps/pay/src/receipt.ts +++ b/apps/pay/src/receipt.ts @@ -123,7 +123,8 @@ export async function generateReceipt(paymentId: number): Promise { `; - // Lock it - await sql`UPDATE payments SET receipt_html = ${html} WHERE id = ${paymentId}`; - return html; + // Minify and lock it + const minified = html.replace(/\n\s*/g, "").replace(/>\s+<").replace(/\s{2,}/g, " "); + await sql`UPDATE payments SET receipt_html = ${minified} WHERE id = ${paymentId}`; + return minified; }