diff --git a/connectors/src/connectors/google_drive/index.ts b/connectors/src/connectors/google_drive/index.ts index 641c18837049..432dbf1c17ad 100644 --- a/connectors/src/connectors/google_drive/index.ts +++ b/connectors/src/connectors/google_drive/index.ts @@ -131,7 +131,16 @@ export class GoogleDriveConnectorManager extends BaseConnectorManager { googleDriveConfigurationBlob ); - await upsertSharedWithMeFolder(connector); + // Upserts to data_sources_folders (core) a top-level folder "Shared with me". + const folderId = getInternalId(GOOGLE_DRIVE_SHARED_WITH_ME_VIRTUAL_ID); + await upsertDataSourceFolder({ + dataSourceConfig: dataSourceConfigFromConnector(connector), + folderId, + parents: [folderId], + parentId: null, + title: "Shared with me", + mimeType: "application/vnd.dust.googledrive.folder", + }); // We mark it artificially as sync succeeded as google drive is created empty. await syncSucceeded(connector.id); @@ -982,18 +991,3 @@ function getSourceUrlForGoogleDriveFiles(f: GoogleDriveFiles): string { return `https://drive.google.com/file/d/${f.driveFileId}/view`; } - -/** - * Upserts to data_sources_folders (core) a top-level folder "Shared with me". - */ -async function upsertSharedWithMeFolder(connector: ConnectorResource) { - const folderId = getInternalId(GOOGLE_DRIVE_SHARED_WITH_ME_VIRTUAL_ID); - await upsertDataSourceFolder({ - dataSourceConfig: dataSourceConfigFromConnector(connector), - folderId, - parents: [folderId], - parentId: null, - title: "Shared with me", - mimeType: "application/vnd.dust.googledrive.folder", - }); -}