Skip to content

Instantly share code, notes, and snippets.

@owfm
Last active May 16, 2020 10:59
Show Gist options
  • Save owfm/a76ef64d912585f6f8785d5212e2b3e0 to your computer and use it in GitHub Desktop.
Save owfm/a76ef64d912585f6f8785d5212e2b3e0 to your computer and use it in GitHub Desktop.
// getPendingPromotions.js
import handler from "./libs/handler-lib";
import AWS from "aws-sdk";
const client = new AWS.DynamoDB.DocumentClient();
export const call = handler(async (event, context) => {
const params = {
TableName: process.env.promotionsTable,
IndexName: "decisionStatus",
KeyConditionExpression: "decisionStatus = :decisionStatus",
ExpressionAttributeValues: {
":decisionStatus": "decisionPending",
},
};
const result = await client.query(params).promise();
return result.Items;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment