From fa2f4611552944a4ce6024c7218bfbe256eeb568 Mon Sep 17 00:00:00 2001 From: Ben Vinegar <2153+benvinegar@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:17:45 -0500 Subject: [PATCH] Fix type error in dashboard.tsx --- app/routes/dashboard.tsx | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/routes/dashboard.tsx b/app/routes/dashboard.tsx index 04934058..3b1c782b 100644 --- a/app/routes/dashboard.tsx +++ b/app/routes/dashboard.tsx @@ -38,7 +38,7 @@ declare module "@remix-run/server-runtime" { export const loader = async ({ context, request }: LoaderFunctionArgs) => { const analyticsEngine = new AnalyticsEngineAPI( context.env.CF_ACCOUNT_ID, - context.env.CF_BEARER_TOKEN + context.env.CF_BEARER_TOKEN, ); const url = new URL(request.url); @@ -115,7 +115,7 @@ export const loader = async ({ context, request }: LoaderFunctionArgs) => { // await all requests to AE then return the results return json({ siteId: siteId, - sites: (await sitesByHits).map(([site]: [string]) => site), + sites: (await sitesByHits).map(([site, _]: [string, number]) => site), views: (await counts).views, visits: (await counts).visits, visitors: (await counts).visitors, @@ -130,7 +130,7 @@ export const loader = async ({ context, request }: LoaderFunctionArgs) => { }; function convertCountryCodesToNames( - countByCountry: AnalyticsQueryResultRow[] + countByCountry: AnalyticsQueryResultRow[], ): AnalyticsQueryResultRow[] { const regionNames = new Intl.DisplayNames(["en"], { type: "region" }); return countByCountry.map((countByBrowserRow: AnalyticsQueryResultRow) => { diff --git a/package.json b/package.json index 5940affd..ea13687e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "build": "remix build", - "deploy": "npm run build && wrangler deploy", + "deploy": "wrangler deploy", "dev": "remix dev --manual -c \"npm start\"", "lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .", "start": "wrangler dev ./build/index.js",