From eb74444644de84580db529a50a66c0136af8cbce Mon Sep 17 00:00:00 2001 From: Jorge Padilla Date: Thu, 15 Feb 2024 12:29:10 -0500 Subject: [PATCH] fix(frontend): fix delete resource navigation --- web/src/hooks/useDeleteResource.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/hooks/useDeleteResource.tsx b/web/src/hooks/useDeleteResource.tsx index c362da05d2..346e309af1 100644 --- a/web/src/hooks/useDeleteResource.tsx +++ b/web/src/hooks/useDeleteResource.tsx @@ -20,10 +20,12 @@ const useDeleteResource = () => { const onConfirmDelete = useCallback( async (id: string, type: ResourceType) => { try { + let path = '/tests'; if (type === ResourceType.Test) { TestAnalyticsService.onDeleteTest(); await deleteTestMutation({testId: id}).unwrap(); } else if (type === ResourceType.TestSuite) { + path = '/testsuites'; await deleteTestSuiteMutation({testSuiteId: id}).unwrap(); } @@ -31,7 +33,8 @@ const useDeleteResource = () => { type: 'success', title: `${capitalize(type)} deleted successfully`, }); - navigate('/'); + + navigate(path); } catch (error) { showNotification({ type: 'error',