parameter | type | description |
---|---|---|
method | string | any valid dynamo document client method |
params | object | object params accepted by the corresponding dynamo document client method |
npm i @tractorzoom/dynamo-utils
import { docClient } from '@tractorzoom/dynamo-utils';
export const putHandler = async () => {
const params = {
Table: 'MyTable',
Item: { key: 'super awesome item' },
};
const response = await docClient('put', params);
if (response.error) {
return internalServerError(response.error);
}
return ok(response);
};