Skip to content

Commit

Permalink
[api] Fix reindex on connector ping method
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed Oct 26, 2019
1 parent 67e4114 commit 52f9012
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions opencti-platform/opencti-graphql/src/domain/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ export const connectorsFor = async (type, scope, onlyAlive = false) => {
filter(c => c.connector_type === type),
filter(c => (onlyAlive ? c.active === true : true)),
// eslint-disable-next-line prettier/prettier
filter(c => scope ? includes(scope.toLowerCase(), map(s => s.toLowerCase(), c.connector_scope)) : true)
filter(c =>
scope
? includes(
scope.toLowerCase(),
map(s => s.toLowerCase(), c.connector_scope)
)
: true
)
)(connects);
};

Expand All @@ -57,7 +64,7 @@ export const pingConnector = async (id, state) => {
const stateInput = { key: 'connector_state', value: [state] };
await updateAttribute(id, stateInput, wTx);
await commitWriteTx(wTx);
return getById(id).then(data => completeConnector(data));
return getById(id, true).then(data => completeConnector(data));
};

export const registerConnector = async ({ id, name, type, scope }) => {
Expand Down

0 comments on commit 52f9012

Please sign in to comment.