async function getAttendeeInfo()

in src/index.js [204:225]


async function getAttendeeInfo(fromNumber, callId) {
    console.log("Querying using fromNumber");

    let params = {
        TableName: process.env.TABLE_NAME,
        KeyConditionExpression: 'fromNumber = :fromNumber and callId = :callId',
        ExpressionAttributeValues: {
            ':fromNumber': { 'S': fromNumber },
            ':callId': { 'S': callId }
        }
    };

    console.log("Query attendee table:", JSON.stringify(params, null, 2));
    const attendee = await dynamodb.query(params).promise();

    if (!attendee.Items) {
        return null;
    }

    console.log("Query succes:", JSON.stringify(attendee, null, 2));
    return attendee.Items;
}