mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
Compare commits
1 Commits
chore/aws-
...
delete-res
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c866aee66 |
@@ -65,7 +65,7 @@ export default function ResponseTimeline({
|
|||||||
observer.unobserve(currentLoadingRef);
|
observer.unobserve(currentLoadingRef);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [responses, responsesPerPage, page, survey.id, fetchedResponses.length, hasMoreResponses]);
|
}, [responsesPerPage, page, survey.id, fetchedResponses.length, hasMoreResponses]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
@@ -89,6 +89,7 @@ export default function ResponseTimeline({
|
|||||||
environmentTags={environmentTags}
|
environmentTags={environmentTags}
|
||||||
pageType="response"
|
pageType="response"
|
||||||
environment={environment}
|
environment={environment}
|
||||||
|
setFetchedResponses={setFetchedResponses}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { TrashIcon } from "@heroicons/react/24/outline";
|
|||||||
import { CheckCircleIcon } from "@heroicons/react/24/solid";
|
import { CheckCircleIcon } from "@heroicons/react/24/solid";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { ReactNode, useState } from "react";
|
import { ReactNode, useState } from "react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
|
|
||||||
@@ -41,6 +40,7 @@ export interface SingleResponseCardProps {
|
|||||||
pageType: string;
|
pageType: string;
|
||||||
environmentTags: TTag[];
|
environmentTags: TTag[];
|
||||||
environment: TEnvironment;
|
environment: TEnvironment;
|
||||||
|
setFetchedResponses: React.Dispatch<React.SetStateAction<TResponse[]>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TooltipRendererProps {
|
interface TooltipRendererProps {
|
||||||
@@ -79,9 +79,9 @@ export default function SingleResponseCard({
|
|||||||
pageType,
|
pageType,
|
||||||
environmentTags,
|
environmentTags,
|
||||||
environment,
|
environment,
|
||||||
|
setFetchedResponses,
|
||||||
}: SingleResponseCardProps) {
|
}: SingleResponseCardProps) {
|
||||||
const environmentId = survey.environmentId;
|
const environmentId = survey.environmentId;
|
||||||
const router = useRouter();
|
|
||||||
const displayIdentifier = response.person ? getPersonIdentifier(response.person) : null;
|
const displayIdentifier = response.person ? getPersonIdentifier(response.person) : null;
|
||||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||||
const [isDeleting, setIsDeleting] = useState(false);
|
const [isDeleting, setIsDeleting] = useState(false);
|
||||||
@@ -152,7 +152,7 @@ export default function SingleResponseCard({
|
|||||||
throw new Error("You are not authorized to perform this action.");
|
throw new Error("You are not authorized to perform this action.");
|
||||||
}
|
}
|
||||||
await deleteResponseAction(response.id);
|
await deleteResponseAction(response.id);
|
||||||
router.refresh();
|
setFetchedResponses((prevResponses) => prevResponses.filter((r) => r.id !== response.id));
|
||||||
toast.success("Submission deleted successfully.");
|
toast.success("Submission deleted successfully.");
|
||||||
setDeleteDialogOpen(false);
|
setDeleteDialogOpen(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user