mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: redirection after deleting a project (#1970)
Co-authored-by: Aaryan Khandelwal <aaryan610@Aaryans-MacBook-Pro.local>
This commit is contained in:
parent
fe1b0c1d73
commit
bf0d0503b2
@ -42,7 +42,7 @@ export const DeleteProjectModal: React.FC<TConfirmProjectDeletionProps> = ({
|
||||
user,
|
||||
}) => {
|
||||
const router = useRouter();
|
||||
const { workspaceSlug } = router.query;
|
||||
const { workspaceSlug, projectId } = router.query;
|
||||
|
||||
const { setToastAlert } = useToast();
|
||||
|
||||
@ -81,6 +81,8 @@ export const DeleteProjectModal: React.FC<TConfirmProjectDeletionProps> = ({
|
||||
);
|
||||
|
||||
if (onSuccess) onSuccess();
|
||||
|
||||
if (projectId && projectId === data.id) router.push(`/${workspaceSlug}/projects`);
|
||||
})
|
||||
.catch(() =>
|
||||
setToastAlert({
|
||||
|
@ -183,9 +183,6 @@ const GeneralSettings: NextPage = () => {
|
||||
data={projectDetails ?? null}
|
||||
isOpen={Boolean(selectProject)}
|
||||
onClose={() => setSelectedProject(null)}
|
||||
onSuccess={() => {
|
||||
router.push(`/${workspaceSlug}/projects`);
|
||||
}}
|
||||
user={user}
|
||||
/>
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="p-8">
|
||||
|
Loading…
Reference in New Issue
Block a user