(core) Fix error when canceling import

Summary:
If cancel was clicked while a transform section was still being
generated in the Importer, an error was thrown. This refactors
the cancelImportFiles API action to take in the file upload id
in place of the entire DataSourceTransformed parameter, which
contains other values that are irrelevant to canceling. One of those
values, the transform section id, was causing the error to be thrown
since it was momentarily null.

Test Plan: Tested manually.

Reviewers: alexmojaki

Reviewed By: alexmojaki

Differential Revision: https://phab.getgrist.com/D3317
This commit is contained in:
George Gevoian
2022-03-09 16:03:02 -08:00
parent 77a5d31afe
commit f02174eb7e
4 changed files with 7 additions and 9 deletions

View File

@@ -209,7 +209,7 @@ export interface ActiveDocAPI {
/**
* Cancels import files, cleans up temporary hidden tables and uploads.
*/
cancelImportFiles(dataSource: DataSourceTransformed, prevTableIds: string[]): Promise<void>;
cancelImportFiles(uploadId: number, prevTableIds: string[]): Promise<void>;
/**
* Returns a diff of changes that will be applied to the destination table from `transformRule`