diff --git a/apps/client/app/routes/posts/[postId]/index.tsx b/apps/client/app/routes/posts/[postId]/index.tsx index 2d63570..e825aa2 100644 --- a/apps/client/app/routes/posts/[postId]/index.tsx +++ b/apps/client/app/routes/posts/[postId]/index.tsx @@ -4,7 +4,7 @@ import { useLiveQuery } from 'dexie-react-hooks'; import { db } from '~/services/db'; import type { IBlogPost } from '~/components/post-preview'; -function Post({ heading, text }: IBlogPost) { +function Post({ heading, text }: Partial) { const navigate = useNavigate(); const handleNavigate = () => { diff --git a/apps/client/app/services/db.ts b/apps/client/app/services/db.ts index 997f5d4..d685325 100644 --- a/apps/client/app/services/db.ts +++ b/apps/client/app/services/db.ts @@ -7,6 +7,8 @@ export interface IAuthor { id: string; username: string; name: string; + dob: string; + createdAt: number; } export interface IPost { @@ -42,6 +44,11 @@ export const db = new MySubClassedDexie(); db.posts.count((count) => { if (count === 0) { db.posts.bulkPut(postsJson.result); - db.authors.bulkPut(authorsJson); + db.authors.bulkPut( + authorsJson.map((author) => ({ + ...author, + createdAt: Date.parse(author.createdAt), + })), + ); } });