async function getDevicesByUsername()

in index.js [158:171]


async function getDevicesByUsername (username) {
  const params = {
    TableName: config.deviceTable,
    IndexName: "ByUsernameThingName",
    KeyConditionExpression: "username = :username",
    ExpressionAttributeValues: {
      ':username': username
    }
  };

  const result = await ddb.query(params).promise();

  return result.Items;
}