Skip to content

Commit

Permalink
fixed typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Oct 26, 2021
1 parent ecb85bd commit 672a0e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions x-pack/plugins/actions/server/lib/action_executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,6 @@ test('throws an error when connector is invalid', async () => {
name: 'Test',
minimumLicenseRequired: 'basic',
validate: {
config: schema.object({
param1: schema.string(),
}),
connector: () => {
return 'error';
},
Expand Down Expand Up @@ -311,7 +308,7 @@ test('throws an error when connector is invalid', async () => {
actionId: '1',
status: 'error',
retry: false,
message: `error validating action type config: [param1]: expected value of type [string] but got [undefined]`,
message: `error validating action type connector: error`,
});
});

Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/actions/server/lib/action_executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ export class ActionExecutor {
let validatedSecrets: Record<string, unknown>;
try {
validatedParams = validateParams(actionType, params);
validatedConfig = validateConfig(actionType, config as Record<string, unknown>);
validatedSecrets = validateSecrets(actionType, secrets as Record<string, unknown>);
validatedConfig = validateConfig(actionType, config);
validatedSecrets = validateSecrets(actionType, secrets);
if (actionType.validate?.connector) {
validateConnector(actionType, {
config: config as Record<string, unknown>,
secrets: secrets as Record<string, unknown>,
config,
secrets,
});
}
} catch (err) {
Expand Down

0 comments on commit 672a0e5

Please sign in to comment.