Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Common/API/CoreAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ class CoreAPI {

trash = <T = any, K = object>(url: string, data?: K, options?: APIOptions): Promise<ResponseType<T>> =>
this.fetchInTime<K>({ url, type: 'DELETE', data, options })

setGlobalAPITimeout = (timeout: number) => {
this.timeout = timeout || FALLBACK_REQUEST_TIMEOUT
}
}

export default CoreAPI
2 changes: 1 addition & 1 deletion src/Common/API/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const dashboardAPI = new CoreAPI({
handleRedirectToLicenseActivation,
})

export const { post, put, patch, get, trash } = dashboardAPI
export const { post, put, patch, get, trash, setGlobalAPITimeout } = dashboardAPI
export { default as CoreAPI } from './CoreAPI'
export { QueryClientProvider } from './QueryClientProvider'
export * from './reactQueryHooks'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const ForceDeleteConfirmationModal = ({
subtitle,
onDelete,
closeConfirmationModal,
isDeleting,
}: ForceDeleteConfirmationProps) => {
const renderSubtitle = () => (
<>
Expand All @@ -43,6 +44,7 @@ export const ForceDeleteConfirmationModal = ({
primaryButtonConfig: {
text: 'Force Delete',
onClick: onDelete,
isLoading: isDeleting,
},
}}
handleClose={closeConfirmationModal}
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Components/ConfirmationModal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export interface CannotDeleteModalProps
* and `ConfirmationModalProps` to configure the force delete confirmation modal.
*/
export interface ForceDeleteConfirmationProps
extends Partial<Pick<DeleteConfirmationModalProps, 'onDelete' | 'closeConfirmationModal'>>,
extends Partial<Pick<DeleteConfirmationModalProps, 'onDelete' | 'closeConfirmationModal' | 'isDeleting'>>,
Partial<Pick<ConfirmationModalProps, 'title' | 'subtitle'>> {}

export interface ConfirmationModalContextType {
Expand Down