Skip to content

Commit

Permalink
[frontend] Fix DeepScan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed Feb 25, 2021
1 parent 69fbd59 commit 34a983b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class ItemMarkings extends Component {
if (markingDefinition.x_opencti_color) {
return (
<Chip
key={markingDefinition.definition}
className={className}
style={{
backgroundColor: markingDefinition.x_opencti_color,
Expand Down
6 changes: 3 additions & 3 deletions opencti-platform/opencti-graphql/src/database/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -1974,13 +1974,13 @@ export const createEntity = async (user, input, type) => {
// endregion

// region mutation deletion
export const deleteElementById = async (user, elementId, type, options = {}) => {
export const deleteElementById = async (user, elementId, type) => {
if (R.isNil(type)) {
/* istanbul ignore next */
throw FunctionalError(`You need to specify a type when deleting an entity`);
}
// Check consistency
const element = await markedLoadById(user, elementId, type, options);
const element = await markedLoadById(user, elementId, type);
await elDeleteElement(user, element);
await storeDeleteEvent(user, element);
// Return id
Expand All @@ -1997,7 +1997,7 @@ export const deleteRelationsByFromAndTo = async (user, fromId, toId, relationshi
const relationsToDelete = await elFindByFromAndTo(user, fromThing.internal_id, toThing.internal_id, relationshipType);
for (let i = 0; i < relationsToDelete.length; i += 1) {
const r = relationsToDelete[i];
await deleteElementById(user, r.internal_id, r.entity_type, opts);
await deleteElementById(user, r.internal_id, r.entity_type);
}
return true;
};
Expand Down
2 changes: 1 addition & 1 deletion opencti-platform/opencti-graphql/src/database/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const lockResource = async (resources, automaticExtension = true) => {
};
const queue = () => {
const timeToWait = expiration - Date.now() - automaticExtensionThreshold;
timeout = setTimeout(() => extend(maxTtl), timeToWait);
timeout = setTimeout(() => extend(), timeToWait);
};
if (automaticExtension) {
queue();
Expand Down

0 comments on commit 34a983b

Please sign in to comment.