Skip to content

Commit 827d9e2

Browse files
author
himaniraghav3
committed
bot suggestions
1 parent b24648c commit 827d9e2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const CopilotOpportunityList: FC<{}> = () => {
103103
const navigate = useNavigate()
104104

105105
const {
106-
data: opportunities, hasMore, isValidating, size, setSize,
106+
data: opportunities, hasMoreOpportunities, isValidating, size, setSize,
107107
}: CopilotOpportunitiesResponse = useCopilotOpportunities()
108108

109109
const tableData = useMemo(() => opportunities.map(opportunity => ({
@@ -129,7 +129,7 @@ const CopilotOpportunityList: FC<{}> = () => {
129129
<Table
130130
columns={tableColumns}
131131
data={tableData}
132-
moreToLoad={hasMore}
132+
moreToLoad={hasMoreOpportunities}
133133
onLoadMoreClick={loadMore}
134134
onRowClick={handleRowClick}
135135
removeDefaultSort

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function copilotOpportunityFactory(data: any): CopilotOpportunity {
2929
export interface CopilotOpportunitiesResponse {
3030
isValidating: boolean;
3131
data: CopilotOpportunity[];
32-
hasMore: boolean,
32+
hasMoreOpportunities: boolean;
3333
size: number;
3434
setSize: (size: number) => void;
3535
}
@@ -61,9 +61,9 @@ export const useCopilotOpportunities = (): CopilotOpportunitiesResponse => {
6161
const opportunities = data ? data.flat() : []
6262

6363
const lastPage = data[data.length - 1] || []
64-
const hasMore = lastPage.length === PAGE_SIZE
64+
const hasMoreOpportunities = lastPage.length === PAGE_SIZE
6565

66-
return { data: opportunities, hasMore, isValidating, setSize: (s: number) => { setSize(s) }, size }
66+
return { data: opportunities, hasMoreOpportunities, isValidating, setSize: (s: number) => { setSize(s) }, size }
6767
}
6868

6969
export type CopilotOpportunityResponse = SWRResponse<CopilotOpportunity, CopilotOpportunity>

0 commit comments

Comments
 (0)