Skip to content

Commit

Permalink
Fix type error in dashboard.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Feb 5, 2024
1 parent 7818688 commit fa2f461
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/routes/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit fa2f461

Please sign in to comment.