diff --git a/opencti-platform/opencti-graphql/src/domain/file.js b/opencti-platform/opencti-graphql/src/domain/file.js index 956457be6301..f410ea5abbd0 100644 --- a/opencti-platform/opencti-graphql/src/domain/file.js +++ b/opencti-platform/opencti-graphql/src/domain/file.js @@ -8,14 +8,14 @@ import { internalLoadById } from '../database/middleware'; import { isStixDomainObjectContainer } from '../schema/stixDomainObject'; import { UnsupportedError } from '../config/errors'; -export const uploadJobImport = async (user, fileId, fileMime, entityId) => { +export const uploadJobImport = async (user, fileId, fileMime, entityId, manual = false) => { let isImportInContainer = false; if (entityId) { const entity = await internalLoadById(user, entityId); isImportInContainer = isStixDomainObjectContainer(entity.entity_type); if (!isImportInContainer) throw UnsupportedError('Cant importing on none container entity'); } - const connectors = await connectorsForImport(user, fileMime, true, true); + const connectors = await connectorsForImport(user, fileMime, true, !manual); if (connectors.length > 0) { // Create job and send ask to broker const createConnectorWork = async (connector) => { @@ -51,7 +51,7 @@ export const uploadJobImport = async (user, fileId, fileMime, entityId) => { export const askJobImport = async (user, filename) => { logApp.debug(`[JOBS] ask import for file ${filename} by ${user.user_email}`); const file = await loadFile(user, filename); - await uploadJobImport(user, file.id, file.metaData.mimetype, file.metaData.entity_id); + await uploadJobImport(user, file.id, file.metaData.mimetype, file.metaData.entity_id, true); return file; };