Skip to content

Commit

Permalink
fix: use correct doc client
Browse files Browse the repository at this point in the history
  • Loading branch information
solaris007 committed Nov 30, 2023
1 parent 00e27b0 commit 7a94ce9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/spacecat-shared-dynamo/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import { DynamoDB } from '@aws-sdk/client-dynamodb';
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';

import query from './modules/query.js';
import getItem from './modules/getItem.js';
Expand All @@ -23,13 +23,13 @@ import removeItem from './modules/removeItem.js';
*
* @param {Object} log - The logging object, defaults to console.
* @param {DynamoDB} dbClient - The AWS SDK DynamoDB client instance.
* @param {DynamoDBDocumentClient} docClient - The AWS SDK DynamoDB Document client instance.
* @param {DynamoDBDocument} docClient - The AWS SDK DynamoDB Document client instance.
* @returns {Object} A client object with methods to interact with DynamoDB.
*/
const createClient = (
log = console,
dbClient = new DynamoDB(),
docClient = DynamoDBDocumentClient.from(dbClient),
docClient = DynamoDBDocument.from(dbClient),
) => ({
query: (params) => query(docClient, params, log),
getItem: (tableName, key) => getItem(docClient, tableName, key, log),
Expand Down

0 comments on commit 7a94ce9

Please sign in to comment.