From 6a083b24c4caa8faaf3dad6cf5f9bb9054e50ef7 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 25 Jul 2024 19:22:18 +0800 Subject: [PATCH] fix typescript error --- app/api/artifact/route.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/api/artifact/route.ts b/app/api/artifact/route.ts index 214fe76a1..ab8485913 100644 --- a/app/api/artifact/route.ts +++ b/app/api/artifact/route.ts @@ -12,12 +12,16 @@ async function handle(req: NextRequest, res: NextResponse) { if (req.method === "POST") { const clonedBody = await req.text(); const hashedCode = md5.hash(clonedBody).trim(); - const body = { + const body: { + key: string; + value: string; + expiration_ttl?: Number; + } = { key: hashedCode, value: clonedBody, }; try { - const ttl = parseInt(serverConfig.cloudflareKVTTL); + const ttl = parseInt(serverConfig.cloudflareKVTTL as string); if (ttl > 60) { body["expiration_ttl"] = ttl; }