diff --git a/packages/import-handler/src/index.ts b/packages/import-handler/src/index.ts index 209edd852..d1cfd9ebb 100644 --- a/packages/import-handler/src/index.ts +++ b/packages/import-handler/src/index.ts @@ -73,13 +73,17 @@ const shouldHandle = (data: StorageEvent) => { const importURL = async ( userId: string, url: URL, - source: string + source: string, + state?: RetrievedDataState, + labels?: string[] ): Promise => { return createCloudTask(CONTENT_FETCH_URL, { userId, source, url: url.toString(), saveRequestId: uuid(), + state, + labels, }) } @@ -129,10 +133,21 @@ const handlerForFile = (name: string): importHandlerFunc | undefined => { return undefined } -const urlHandler = async (ctx: ImportContext, url: URL): Promise => { +const urlHandler = async ( + ctx: ImportContext, + url: URL, + state?: RetrievedDataState, + labels?: string[] +): Promise => { try { // Imports are stored in the format imports//-.csv - const result = await importURL(ctx.userId, url, 'csv-importer') + const result = await importURL( + ctx.userId, + url, + 'csv-importer', + state, + labels + ) if (result) { ctx.countImported += 1 }