From 9aa77314a6e83b9f6b5f606eafb19fb15107ec74 Mon Sep 17 00:00:00 2001 From: Rangga Fajar Oktariansyah <86386385+FajarKim@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:26:39 +0700 Subject: [PATCH] chore: change the card function call by adding `await` --- api/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/index.ts b/api/index.ts index 68a9024..5185ee7 100644 --- a/api/index.ts +++ b/api/index.ts @@ -107,7 +107,7 @@ async function readmeStats(req: any, res: any): Promise { if (uiConfig.Format === "json") { res.json(fetchStats); } else if (uiConfig.Format === "png") { - const svgString = card(fetchStats, uiConfig); + const svgString = await card(fetchStats, uiConfig); const resvg = new Resvg(svgString, { font: { defaultFontFamily: "Segoe UI" }}); const pngBuffer = await resvg.render().asPng(); @@ -115,7 +115,7 @@ async function readmeStats(req: any, res: any): Promise { res.send(pngBuffer); } else { res.setHeader("Content-Type", "image/svg+xml"); - const svg = card(fetchStats, uiConfig); + const svg = await card(fetchStats, uiConfig); res.send(svg); } } catch (error: any) {