Skip to content

Commit 4a592e6

Browse files
committed
chore:: types added for fetchDevtronCloneList
1 parent a0abfe7 commit 4a592e6

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/Pages/App/CreateAppModal/AppClone/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ export type CloneListResponse = {
1515
totalCount: number
1616
}
1717

18+
export interface CloneListTypes {
19+
offset?: number
20+
isJobView?: boolean
21+
searchKey?: string
22+
cloneListAbortControllerRef: React.MutableRefObject<AbortController>
23+
handleCloneAppClick: (app: BaseAppMetaData) => void
24+
}
25+
1826
export interface DevtronAppCloneListProps extends Pick<AppCloneListProps, 'handleCloneAppClick' | 'isJobView'> {
1927
searchKey: string
2028
}

src/Pages/App/CreateAppModal/service.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { abortPreviousRequests, BaseAppMetaData, post } from '@devtron-labs/devtron-fe-common-lib'
17+
import { abortPreviousRequests, post } from '@devtron-labs/devtron-fe-common-lib'
1818

1919
import { getJobs } from '@Components/Jobs/Service'
2020
import { APP_TYPE, Routes } from '@Config/constants'
2121
import { getAppIconWithBackground } from '@Config/utils'
2222
import { getAppListMin } from '@Services/service'
2323

24-
import { CloneListResponse } from './AppClone/types'
24+
import { CloneListResponse, CloneListTypes } from './AppClone/types'
2525

2626
export const createApp = (request) => post(Routes.APP, request)
2727

@@ -31,13 +31,7 @@ export const fetchDevtronCloneList = async ({
3131
searchKey = '',
3232
cloneListAbortControllerRef,
3333
handleCloneAppClick,
34-
}: {
35-
offset?: number
36-
isJobView?: boolean
37-
searchKey?: string
38-
cloneListAbortControllerRef: React.MutableRefObject<AbortController>
39-
handleCloneAppClick: (app: BaseAppMetaData) => void
40-
}): Promise<CloneListResponse> =>
34+
}: CloneListTypes): Promise<CloneListResponse> =>
4135
abortPreviousRequests(async () => {
4236
if (isJobView) {
4337
const res = await getJobs({

0 commit comments

Comments
 (0)