Skip to content

Commit 070098b

Browse files
committed
fix: lint
1 parent 63d486a commit 070098b

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const ApplyOpportunityModal: FC<ApplyOpportunityModalProps> = props => {
2626
setSuccess(true)
2727
}, [props.copilotOpportunityId, notes])
2828

29-
const onChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
29+
const onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void = e => {
3030
setNotes(e.target.value)
3131
}
3232

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ import {
1212
} from '~/libs/ui'
1313
import { profileContext, ProfileContextData, UserRole } from '~/libs/core'
1414

15+
import { CopilotApplication } from '../../models/CopilotApplication'
1516
import {
1617
copilotBaseUrl,
1718
CopilotOpportunityResponse,
1819
useCopilotApplications,
1920
useCopilotOpportunity,
2021
} from '../../services/copilot-opportunities'
2122
import { copilotRoutesMap } from '../../copilots.routes'
22-
import { ApplyOpportunityModal } from './apply-opportunity-modal'
2323

24+
import { ApplyOpportunityModal } from './apply-opportunity-modal'
2425
import styles from './styles.module.scss'
2526

2627
const CopilotOpportunityDetails: FC<{}> = () => {
@@ -33,7 +34,7 @@ const CopilotOpportunityDetails: FC<{}> = () => {
3334
() => !!profile?.roles?.some(role => role === UserRole.copilot),
3435
[profile],
3536
)
36-
const { data: copilotApplications } = useCopilotApplications(opportunityId)
37+
const { data: copilotApplications }: { data?: CopilotApplication[] } = useCopilotApplications(opportunityId)
3738

3839
if (!opportunityId) {
3940
navigate(copilotRoutesMap.CopilotOpportunityList)

src/apps/copilots/src/services/copilot-opportunities.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@ function copilotOpportunityFactory(data: any): CopilotOpportunity {
2727
}
2828
}
2929

30-
/**
31-
* Creates a CopilotApplication object by merging the provided data and its nested data
32-
* @param data
33-
* @returns
34-
*/
35-
function opportunityApplicationFactory(data: any): CopilotApplication[] {
36-
return data
37-
}
38-
3930
export interface CopilotOpportunitiesResponse {
4031
isValidating: boolean;
4132
data: CopilotOpportunity[];
@@ -52,7 +43,9 @@ export interface CopilotOpportunitiesResponse {
5243
export const useCopilotOpportunities = (): CopilotOpportunitiesResponse => {
5344
const getKey = (pageIndex: number, previousPageData: CopilotOpportunity[]): string | undefined => {
5445
if (previousPageData && previousPageData.length < PAGE_SIZE) return undefined
55-
return `${copilotBaseUrl}/copilots/opportunities?page=${pageIndex + 1}&pageSize=${PAGE_SIZE}&sort=createdAt desc`
46+
return `
47+
${copilotBaseUrl}/copilots/opportunities?page=${pageIndex + 1}&pageSize=${PAGE_SIZE}&sort=createdAt desc
48+
`
5649
}
5750

5851
const fetcher = (url: string): Promise<CopilotOpportunity[]> => xhrGetAsync<CopilotOpportunity[]>(url)
@@ -106,7 +99,7 @@ export const useCopilotOpportunity = (opportunityId?: string): CopilotOpportunit
10699
*/
107100
export const applyCopilotOpportunity = async (opportunityId: number, request: {
108101
notes?: string;
109-
}) => {
102+
}): Promise<CopilotApplication> => {
110103
const url = `${copilotBaseUrl}/copilots/opportunity/${opportunityId}/apply`
111104

112105
return xhrPostAsync(url, request, {})
@@ -119,7 +112,9 @@ export const applyCopilotOpportunity = async (opportunityId: number, request: {
119112
* @returns {CopilotApplicationResponse} - The response containing the copilot application data.
120113
*/
121114
export const useCopilotApplications = (opportunityId?: string): CopilotApplicationResponse => {
122-
const url = opportunityId ? buildUrl(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) : undefined
115+
const url = opportunityId
116+
? buildUrl(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`)
117+
: undefined
123118

124119
const fetcher = (urlp: string): Promise<CopilotApplication[]> => xhrGetAsync<CopilotApplication[]>(urlp)
125120
.then(data => data)

0 commit comments

Comments
 (0)