async function removeLiveForPlayer()

in backend/Functions/HTTP/activegames_delete/app.js [47:61]


async function removeLiveForPlayer(playerName) {
  try {
    const parms = {TableName: playerInventoryTableName, IndexName: 'gsi-GameType',
      KeyConditionExpression:'gameType=:gameType',
      ExpressionAttributeValues:{':gameType':'LIVE='+playerName}
    };
    const otherLiveGames = await ddb.query(parms).promise();
    for(var i=0;i<otherLiveGames.Count;i++) {
        await removeLiveGame(otherLiveGames.Items[i].pk, otherLiveGames.Items[i].sk);
    }
  } catch(e) {
    console.error(`error querying for live games ${e}`);
    return false;
  }
}