Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
fastner committed Aug 7, 2024
1 parent 6e08d37 commit 3f00f0a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
11 changes: 8 additions & 3 deletions app/routes/analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ export async function action({ request }: ActionFunctionArgs) {

const data = (await request.json()) as AnalyticsData

const entry: DatabaseAnalyticsData = { ...data, id: data.metric.id, createdAt: new Date().toISOString() }
const entry: DatabaseAnalyticsData = {
...data,
id: data.metric.id,
createdAt: new Date().toISOString()
}

try {

// eslint-disable-next-line new-cap
await aws.DynamoDB.PutItem({
TableName: Resource.WebVitals.name,
Item: entry
})
} catch (error) {
return new Response(`Error saving data: ${error as string}`, { status: 500 })
return new Response(`Error saving data: ${error as string}`, {
status: 500
})
}

return new Response("", { status: 204 })
Expand Down
2 changes: 1 addition & 1 deletion aws-lite.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module '@aws-lite/dynamodb';
declare module "@aws-lite/dynamodb"
18 changes: 4 additions & 14 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@
"**/.client/**/*.tsx"
],
"compilerOptions": {
"lib": [
"DOM",
"DOM.Iterable",
"ES2022"
],
"types": [
"@remix-run/node",
"vite/client",
"@aws-lite/dynamodb-types"
],
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"types": ["@remix-run/node", "vite/client", "@aws-lite/dynamodb-types"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
Expand All @@ -31,11 +23,9 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": [
"./app/*"
]
"~/*": ["./app/*"]
},
// Vite takes care of building everything, not tsc.
"noEmit": true
}
}
}

0 comments on commit 3f00f0a

Please sign in to comment.