attempt: minify invoice html

This commit is contained in:
nate 2026-03-19 14:01:31 +04:00
parent dad663b5e3
commit eae2b3869d
1 changed files with 4 additions and 3 deletions

View File

@ -123,7 +123,8 @@ export async function generateReceipt(paymentId: number): Promise<string> {
</body>
</html>`;
// 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+</g, "><").replace(/\s{2,}/g, " ");
await sql`UPDATE payments SET receipt_html = ${minified} WHERE id = ${paymentId}`;
return minified;
}