Skip to content

Commit

Permalink
[api] Fix creation of StixObservable
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed Dec 5, 2019
1 parent 6341829 commit 4f2d4c6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ export const addStixObservable = async (user, stixObservable) => {
const innerType = stixObservable.type;
let observableToCreate = dissoc('type', stixObservable);
if (observableToCreate.stix_id_key) {
observableToCreate = assoc('stix_id_key', observableToCreate.stix_id_key.replace('indicator', 'observable'));
observableToCreate = assoc(
'stix_id_key',
observableToCreate.stix_id_key.replace('indicator', 'observable'),
observableToCreate
);
}
const created = await createEntity(observableToCreate, innerType, {
modelType: TYPE_STIX_OBSERVABLE,
Expand Down

0 comments on commit 4f2d4c6

Please sign in to comment.