Skip to content

Commit

Permalink
作者詳細で本全件取得よくないね
Browse files Browse the repository at this point in the history
  • Loading branch information
a01sa01to committed Mar 24, 2024
1 parent 29a7ddc commit b8819cc
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -18,7 +18,6 @@ import {
import { useToggle } from '@uidotdev/usehooks';

import { useAuthor } from '../../../../features/authors/hooks/useAuthor';
import { useBookList } from '../../../../features/books/hooks/useBookList';

import { AuthorDetailContent } from './AuthorDetailContent';
import { AuthorEditContent } from './AuthorEditContent';
Expand All @@ -30,11 +29,10 @@ export type Props = {
};

export const AuthorDetailModal: React.FC<Props> = ({ authorId, isOpen, onClose }) => {
const { data: allBookList } = useBookList();
const { data: author } = useAuthor({ authorId });
const [isEdit, toggleIsEdit] = useToggle(false);

const bookList = allBookList?.filter((book) => book.author.id === authorId);
const bookList = author?.books;

return (
<Modal isOpen={isOpen} onClose={onClose} size="4xl">
Expand Down

0 comments on commit b8819cc

Please sign in to comment.