Skip to content

Commit

Permalink
Deployment issues
Browse files Browse the repository at this point in the history
  • Loading branch information
david emioma committed Jun 8, 2024
1 parent fea2905 commit 3802f26
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React from "react";
import { toast } from "sonner";
import axios, { AxiosError } from "axios";
import { useForm } from "react-hook-form";
import { useRouter } from "next/navigation";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { Textarea } from "@/components/ui/textarea";
Expand All @@ -27,12 +26,6 @@ type Props = {
};

const ReviewForm = ({ showForm, productId }: Props) => {
if (!showForm) {
return null;
}

const router = useRouter();

const queryClient = useQueryClient();

const form = useForm<ReviewValidator>({
Expand All @@ -54,8 +47,6 @@ const ReviewForm = ({ showForm, productId }: Props) => {

form.reset();

router.refresh();

queryClient.invalidateQueries({
queryKey: ["get-reviews-details", productId],
});
Expand All @@ -81,6 +72,10 @@ const ReviewForm = ({ showForm, productId }: Props) => {
addReview(values);
};

if (!showForm) {
return null;
}

return (
<div className="w-full space-y-4" data-cy={`review-form-${productId}`}>
<div className="space-y-0.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { format } from "date-fns";
import { ReviewType } from "@/types";
import { UserRole } from "@prisma/client";
import axios, { AxiosError } from "axios";
import { useRouter } from "next/navigation";
import { Button } from "@/components/ui/button";
import { FaStar, FaRegStar } from "react-icons/fa6";
import useCurrentUser from "@/hooks/use-current-user";
Expand All @@ -20,8 +19,6 @@ type Props = {
};

const ReviewItem = ({ review, productId, disabled }: Props) => {
const router = useRouter();

const { user } = useCurrentUser();

const queryClient = useQueryClient();
Expand All @@ -34,8 +31,6 @@ const ReviewItem = ({ review, productId, disabled }: Props) => {
onSuccess: (data) => {
toast.success("Marked as helpful");

router.refresh();

queryClient.invalidateQueries({
queryKey: ["get-limited-reviews", productId],
});
Expand Down Expand Up @@ -66,8 +61,6 @@ const ReviewItem = ({ review, productId, disabled }: Props) => {
onSuccess: () => {
toast.success("Review Deleted!");

router.refresh();

queryClient.invalidateQueries({
queryKey: ["get-reviews-details", productId],
});
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@aws-sdk/client-rekognition": "^3.569.0",
"@hookform/resolvers": "^3.3.4",
"@mantine/hooks": "^7.5.2",
"@prisma/client": "^5.8.1",
"@prisma/client": "^5.15.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-avatar": "^1.0.4",
Expand Down Expand Up @@ -56,7 +56,7 @@
"input-otp": "^1.2.4",
"lodash.debounce": "^4.0.8",
"lucide-react": "^0.319.0",
"next": "14.1.1",
"next": "^14.1.1",
"next-auth": "^5.0.0-beta.4",
"node-fetch": "^3.3.2",
"nodemailer": "^6.9.9",
Expand Down

0 comments on commit 3802f26

Please sign in to comment.