Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct doc client #9

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading