Skip to content

Commit fda847d

Browse files
fix
1 parent 40522cc commit fda847d

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/blocks/aws-athena/src/lib/actions/query-athena-action.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const runAthenaQueryAction = createAction({
1616
displayName: 'Query Athena database',
1717
isWriteAction: false,
1818
props: {
19-
account: getAwsAccountsSingleSelectDropdown().accounts,
19+
accounts: getAwsAccountsSingleSelectDropdown().accounts,
2020
region: Property.StaticDropdown({
2121
displayName: 'Region',
2222
description:
@@ -33,9 +33,9 @@ export const runAthenaQueryAction = createAction({
3333
database: Property.Dropdown<string>({
3434
displayName: 'Database',
3535
description: 'Database that contains the table to query on',
36-
refreshers: ['auth', 'account', 'account.accounts', 'region'],
36+
refreshers: ['auth', 'accounts', 'accounts.accounts', 'region'],
3737
required: true,
38-
options: async ({ auth, account, region }: any) => {
38+
options: async ({ auth, accounts, region }: any) => {
3939
if (!auth) {
4040
return {
4141
disabled: true,
@@ -47,7 +47,7 @@ export const runAthenaQueryAction = createAction({
4747
try {
4848
const credentials = await getCredentialsForAccount(
4949
auth,
50-
account?.['accounts'],
50+
accounts?.['accounts'],
5151
);
5252

5353
const databases = await listAthenaDatabases(
@@ -110,7 +110,7 @@ export const runAthenaQueryAction = createAction({
110110
try {
111111
const credentials = await getCredentialsForAccount(
112112
context.auth,
113-
context.propsValue.account?.['accounts'],
113+
context.propsValue.accounts?.['accounts'],
114114
);
115115

116116
return await runAndWaitForQueryResult(

packages/blocks/aws-athena/test/athena-query-action.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const openopsCommonMock = {
22
...jest.requireActual('@openops/common'),
3-
getCredentialsForAccount: jest.fn(),
3+
getCredentialsForaccounts: jest.fn(),
44
runAndWaitForQueryResult: jest.fn(),
55
};
66

@@ -25,7 +25,7 @@ describe('runAthenaQueryAction tests', () => {
2525

2626
test('should create action with correct properties', () => {
2727
expect(runAthenaQueryAction.props).toMatchObject({
28-
account: {
28+
accounts: {
2929
type: 'DYNAMIC',
3030
},
3131
region: {
@@ -76,7 +76,7 @@ describe('runAthenaQueryAction tests', () => {
7676
...jest.requireActual('@openops/blocks-framework'),
7777
auth: auth,
7878
propsValue: {
79-
account: { accounts: ['some-account-id'] },
79+
accounts: { accounts: ['some-account-id'] },
8080
query: 'some query',
8181
database: 'some database',
8282
outputBucket: 'some outputBucket',
@@ -136,7 +136,7 @@ describe('runAthenaQueryAction tests', () => {
136136
...jest.requireActual('@openops/blocks-framework'),
137137
auth: auth,
138138
propsValue: {
139-
account: { accounts: ['some-account-id'] },
139+
accounts: { accounts: ['some-account-id'] },
140140
region: 'some region',
141141
query: 'some query',
142142
database: 'some database',

0 commit comments

Comments
 (0)