attempt: minify invoice html
This commit is contained in:
parent
dad663b5e3
commit
eae2b3869d
|
|
@ -123,7 +123,8 @@ export async function generateReceipt(paymentId: number): Promise<string> {
|
||||||
</body>
|
</body>
|
||||||
</html>`;
|
</html>`;
|
||||||
|
|
||||||
// Lock it
|
// Minify and lock it
|
||||||
await sql`UPDATE payments SET receipt_html = ${html} WHERE id = ${paymentId}`;
|
const minified = html.replace(/\n\s*/g, "").replace(/>\s+</g, "><").replace(/\s{2,}/g, " ");
|
||||||
return html;
|
await sql`UPDATE payments SET receipt_html = ${minified} WHERE id = ${paymentId}`;
|
||||||
|
return minified;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue