Skip to content

Commit

Permalink
correcao no endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
thaisrocine committed Feb 14, 2025
1 parent 0243d4b commit 55d0ce4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/app/reviews/view/[bookId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@ export default function Reviews() {
const router = useRouter();

const handleCreateReview = (type: string) => {
if (book) {
if (!book?.id) {
console.error("ID do livro não encontrado!");
return;
}

if (type === "create") {
localStorage.setItem("bookIdForReview", book.id);
if (type === "create") {
router.push("/reviews/create");
} else {
console.log(book.id, "meu id book");
router.push(`/reviews/all/${book.id}`);
}
router.push("/reviews/create");
} else {
router.push(`/reviews/book/${book.id}`);
}
};

useEffect(() => {
if (!bookId || Array.isArray(bookId)) {
setError("ID do livro inválido.");
setError("ID do livro inválido!");
setLoading(false);
return;
}
Expand Down

1 comment on commit 55d0ce4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for bookhive-web ready!

✅ Preview
https://bookhive-335y09igq-amiltoncabrals-projects.vercel.app

Built with commit 55d0ce4.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.