Last active
May 16, 2020 10:59
-
-
Save owfm/a76ef64d912585f6f8785d5212e2b3e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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