Skip to content

Commit

Permalink
[backend] wip: relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
marieflorescontact committed Dec 9, 2024
1 parent 8a7211f commit b76f7ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion opencti-platform/opencti-graphql/src/database/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -2871,7 +2871,8 @@ export const createRelationRaw = async (context, user, rawInput, opts = {}) => {
message: opts.commitMessage,
external_references: references.map((ref) => convertExternalReferenceToStix(ref))
} : undefined;
event = await storeUpdateEvent(context, user, previous, instance, message, { ...opts, commit });
const relatedRestrictions = extractObjectsRestrictionsFromInputs(inputs);
event = await storeUpdateEvent(context, user, previous, instance, message, { ...opts, commit, relatedRestrictions });
dataRel.element.from = instance; // dynamically update the from to have an up to date relation
} else {
const createdRelation = { ...resolvedInput, ...dataRel.element };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const relInputs = [
internal_id: '23c0c086-afee-45e5-b276-872948997816',
lang: 'en',
modified: '2024-12-06T08:41:59.290Z',
'object-marking ': [
'object-marking': [
'eaccd139-ec2e-48d9-b2ef-a17ba6e7e938'
],
parent_types: [
Expand Down

0 comments on commit b76f7ad

Please sign in to comment.