Skip to content

Commit

Permalink
style: apply prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
myrddin-prophecies committed Mar 23, 2024
1 parent 8ad7cf3 commit 5d5841e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
5 changes: 2 additions & 3 deletions src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
),
];
15 changes: 7 additions & 8 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/pages/posts/[postId]/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? <EditPost post={posts[0]} /> : null;
Expand Down
5 changes: 2 additions & 3 deletions src/pages/posts/[postId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/pages/users/[userName].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d5841e

Please sign in to comment.