[WEB-2190] fix: unauthorised delete and redirections (#5342)

* fix: cycle unauthorised delete action redirection

* fix: intake unauthorised delete action redirection
This commit is contained in:
Anmol Singh Bhatia 2024-08-09 19:14:38 +05:30 committed by GitHub
parent 679b0b6465
commit 6d0cf1b4e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 19 deletions

View file

@ -42,6 +42,7 @@ export const CycleDeleteModal: React.FC<ICycleDelete> = observer((props) => {
try {
await deleteCycle(workspaceSlug, projectId, cycle.id)
.then(() => {
if (cycleId || peekCycle) router.push(`/${workspaceSlug}/projects/${projectId}/cycles`);
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
@ -68,8 +69,6 @@ export const CycleDeleteModal: React.FC<ICycleDelete> = observer((props) => {
});
})
.finally(() => handleClose());
if (cycleId || peekCycle) router.push(`/${workspaceSlug}/projects/${projectId}/cycles`);
} catch (error) {
setToast({
type: TOAST_TYPE.ERROR,

View file

@ -140,7 +140,7 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
const handleInboxIssueDelete = async () => {
if (!inboxIssue || !currentInboxIssueId) return;
await deleteInboxIssue(workspaceSlug, projectId, currentInboxIssueId).finally(() => {
await deleteInboxIssue(workspaceSlug, projectId, currentInboxIssueId).then(() => {
if (!isNotificationEmbed) router.push(`/${workspaceSlug}/projects/${projectId}/inbox`);
});
};