From 5d5841e90eac94bb23e95cccda80a8ac6d0edb29 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 23 Mar 2024 15:45:55 +0530 Subject: [PATCH] style: apply prettier --- src/mocks/handlers.ts | 5 ++--- src/pages/index.tsx | 15 +++++++-------- src/pages/posts/[postId]/edit.tsx | 5 ++--- src/pages/posts/[postId]/index.tsx | 5 ++--- src/pages/users/[userName].tsx | 7 ++----- 5 files changed, 15 insertions(+), 22 deletions(-) diff --git a/src/mocks/handlers.ts b/src/mocks/handlers.ts index d0193ab..960dbf2 100644 --- a/src/mocks/handlers.ts +++ b/src/mocks/handlers.ts @@ -3,8 +3,7 @@ import { rest } from 'msw'; import postsJson from './posts.json'; export const handlers = [ - rest.get( - '/posts', - async (req, res, ctx) => res(ctx.status(200), ctx.json(postsJson)), + rest.get('/posts', async (req, res, ctx) => + res(ctx.status(200), ctx.json(postsJson)), ), ]; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 16a6562..6c55545 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -14,14 +14,13 @@ function handleDeleteStory(id: string) { } export function PostList() { - const posts = useLiveQuery( - async () => - db.posts - // .where('text') - // .anyOf(['The']) - .orderBy('createdAt') - .reverse() - .toArray(), + const posts = useLiveQuery(async () => + db.posts + // .where('text') + // .anyOf(['The']) + .orderBy('createdAt') + .reverse() + .toArray(), ); return posts diff --git a/src/pages/posts/[postId]/edit.tsx b/src/pages/posts/[postId]/edit.tsx index 7c5b261..efdd352 100644 --- a/src/pages/posts/[postId]/edit.tsx +++ b/src/pages/posts/[postId]/edit.tsx @@ -153,9 +153,8 @@ export function EditPost({ post }: IBlogPostProps) { function EditPostWrapper() { const { postId } = useParams(); - const posts = useLiveQuery( - async () => - db.posts.filter(({ id }) => id === Number(postId)).toArray(), + const posts = useLiveQuery(async () => + db.posts.filter(({ id }) => id === Number(postId)).toArray(), ); return posts ? : null; diff --git a/src/pages/posts/[postId]/index.tsx b/src/pages/posts/[postId]/index.tsx index b898fcd..3e179ae 100644 --- a/src/pages/posts/[postId]/index.tsx +++ b/src/pages/posts/[postId]/index.tsx @@ -32,9 +32,8 @@ function Post({ heading, text }: IBlogPost) { function BlogPost() { const { postId } = useParams(); - const postArr = useLiveQuery( - async () => - db.posts.filter(({ id }) => id === Number(postId)).toArray(), + const postArr = useLiveQuery(async () => + db.posts.filter(({ id }) => id === Number(postId)).toArray(), ); return postArr diff --git a/src/pages/users/[userName].tsx b/src/pages/users/[userName].tsx index 6cb637b..d51fb43 100644 --- a/src/pages/users/[userName].tsx +++ b/src/pages/users/[userName].tsx @@ -18,11 +18,8 @@ function Info({ name }: IUser) { function UserInfo() { const { userName } = useParams(); - const authorArr = useLiveQuery( - async () => - db.authors - .filter(({ username }) => username === userName) - .toArray(), + const authorArr = useLiveQuery(async () => + db.authors.filter(({ username }) => username === userName).toArray(), ); return authorArr