Skip to content

Commit

Permalink
[backend] use constants
Browse files Browse the repository at this point in the history
  • Loading branch information
marieflorescontact committed Jan 6, 2025
1 parent 754fe05 commit 8bc064a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions opencti-platform/opencti-graphql/src/database/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import { isStixCoreRelationship } from '../schema/stixCoreRelationship';
import { isStixSightingRelationship } from '../schema/stixSightingRelationship';
import conf from '../config/conf';
import { now } from '../utils/format';
import { isStixRefRelationship } from '../schema/stixRefRelationship';
import { isStixRefRelationship, RELATION_OBJECT_MARKING } from '../schema/stixRefRelationship';
import { schemaAttributesDefinition } from '../schema/schema-attributes';
import { getDraftContext } from '../utils/draftContext';
import { INPUT_OBJECTS } from '../schema/general';

export const ES_INDEX_PREFIX = conf.get('elasticsearch:index_prefix') || 'opencti';
const rabbitmqPrefix = conf.get('rabbitmq:queue_prefix');
Expand Down Expand Up @@ -329,8 +330,8 @@ export const extractIdsFromStoreObject = (instance) => {
export const extractObjectsRestrictionsFromInputs = (inputs) => {
const markings = [];
inputs.forEach((input) => {
if (input && input.key === 'objects' && input.value?.length > 0) {
const objectMarking = input.value.flatMap((value) => value['object-marking'] ?? []);
if (input && input.key === INPUT_OBJECTS && input.value?.length > 0) {
const objectMarking = input.value.flatMap((value) => value[RELATION_OBJECT_MARKING] ?? []);
markings.push(...objectMarking);
}
});
Expand Down

0 comments on commit 8bc064a

Please sign in to comment.