Skip to content

Commit 9b6c7bc

Browse files
committed
fix: refetch opportunity details on canceling opportunity
1 parent d67e59e commit 9b6c7bc

File tree

1 file changed

+4
-2
lines changed
  • src/apps/copilots/src/pages/copilot-opportunity-details

1 file changed

+4
-2
lines changed

src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848
import { OpportunityDetails } from './tabs/opportunity-details'
4949
import { CopilotApplications } from './tabs/copilot-applications'
5050
import styles from './styles.module.scss'
51+
import { toast } from 'react-toastify'
5152

5253
const CopilotOpportunityDetails: FC<{}> = () => {
5354
const { opportunityId }: {opportunityId?: string} = useParams<{ opportunityId?: string }>()
@@ -105,7 +106,7 @@ const CopilotOpportunityDetails: FC<{}> = () => {
105106

106107
const onApplied: () => void = useCallback(() => {
107108
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`)
108-
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}`)
109+
mutate(`${copilotBaseUrl}/copilot/opportunity/${opportunityId}`)
109110
}, [])
110111

111112
const onCloseApplyModal: () => void = useCallback(() => {
@@ -125,7 +126,8 @@ const CopilotOpportunityDetails: FC<{}> = () => {
125126
if (opportunityId) {
126127
await cancelCopilotOpportunity(opportunityId)
127128
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`)
128-
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}`)
129+
mutate(`${copilotBaseUrl}/copilot/opportunity/${opportunityId}`)
130+
toast.success("Canceled copilot opportunity successfully")
129131
}
130132

131133
}

0 commit comments

Comments
 (0)