Skip to content

Conversation

@hentrymartin
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-1610

What's in this PR?

  • Updated toast message and tooltip copy for directly accepting copilot

opportunityStatus: string,
existingMembership?: ExistingMembership,
projectName: string,
onApplied: () => void,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of the onApplied function property to the CopilotApplication interface should include a description of its purpose and usage in the context of the application. Ensure that this function is implemented and utilized correctly wherever the CopilotApplication interface is used.

import { useParams } from 'react-router-dom'
import { toast } from 'react-toastify'
import { mutate } from 'swr'
import { useCallback, useMemo, useState } from 'react'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the mutate import suggests that it is no longer used in this file. Ensure that any related functionality relying on mutate is either updated or removed to prevent potential issues.

toast.success('Invited a copilot')
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`)
toast.success('Accepted as copilot')
copilotApplication.onApplied()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mutate function call has been removed. Ensure that the removal of this line does not affect the application's state management or data fetching logic. If this line was responsible for revalidating or updating the cache, consider implementing an alternative approach to maintain the application's data consistency.

await assignCopilotOpportunity(opportunityId, copilotApplication.id)
toast.success('Accepted as copilot')
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`)
copilotApplication.onApplied()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line copilotApplication.onApplied() replaces the previous mutate function call. Ensure that onApplied() correctly handles the cache update or any necessary side effects that mutate was performing. If onApplied() does not handle these, consider maintaining the mutate call or implementing the necessary logic within onApplied().

activeProjects: member?.activeProjects || 0,
fulfilment: member?.copilotFulfillment || 0,
handle: member?.handle,
onApplied: props.onApplied,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of onApplied: props.onApplied seems to be a new property being passed to the component. Ensure that onApplied is defined and used appropriately within the component to avoid potential runtime errors.

@hentrymartin hentrymartin requested a review from kkartunov August 7, 2025 23:13
@hentrymartin hentrymartin merged commit b50cfaa into dev Aug 8, 2025
3 checks passed
@hentrymartin hentrymartin deleted the pm-1610 branch August 8, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants