mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: delete import (#859)
This commit is contained in:
parent
7aa9e0bba1
commit
bd0cfef02f
@ -45,7 +45,7 @@ export const DeleteImportModal: React.FC<Props> = ({ isOpen, handleClose, data }
|
||||
false
|
||||
);
|
||||
|
||||
IntegrationService.deleteImporterService(workspaceSlug as string, data.id)
|
||||
IntegrationService.deleteImporterService(workspaceSlug as string, data.service, data.id)
|
||||
.catch(() =>
|
||||
setToastAlert({
|
||||
type: "error",
|
||||
@ -53,7 +53,10 @@ export const DeleteImportModal: React.FC<Props> = ({ isOpen, handleClose, data }
|
||||
message: "Something went wrong. Please try again.",
|
||||
})
|
||||
)
|
||||
.finally(() => setDeleteLoading(false));
|
||||
.finally(() => {
|
||||
setDeleteLoading(false);
|
||||
handleClose();
|
||||
});
|
||||
};
|
||||
|
||||
if (!data) return <></>;
|
||||
|
@ -43,8 +43,12 @@ class IntegrationService extends APIService {
|
||||
});
|
||||
}
|
||||
|
||||
async deleteImporterService(workspaceSlug: string, importerId: string): Promise<any> {
|
||||
return this.delete(`/api/workspaces/${workspaceSlug}/importers/${importerId}/`)
|
||||
async deleteImporterService(
|
||||
workspaceSlug: string,
|
||||
service: string,
|
||||
importerId: string
|
||||
): Promise<any> {
|
||||
return this.delete(`/api/workspaces/${workspaceSlug}/importers/${service}/${importerId}/`)
|
||||
.then((res) => res?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
|
Loading…
Reference in New Issue
Block a user