From b8755ae71fba0ffe6bab9ad2317587b4d65676d0 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 13 Nov 2023 18:24:38 -0500 Subject: [PATCH] change label of primary key in queries --- src/authorizeRequest/authorizeRequest.js | 2 +- src/authorizeRequest/getProtectedSites.js | 2 +- src/getOrCreateObject/resizeAndSave/lookupCustomCrop.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/authorizeRequest/authorizeRequest.js b/src/authorizeRequest/authorizeRequest.js index 9ec9c6f..3627c98 100644 --- a/src/authorizeRequest/authorizeRequest.js +++ b/src/authorizeRequest/authorizeRequest.js @@ -69,7 +69,7 @@ async function authorizeRequest(userRequest, siteRule) { // to avoid INFO Failed to find the group in DynamoDB for group: entire-bu-community const { Item } = await dynamoDb.get({ TableName: tableName, - Key: { SiteAndGroupKey: siteAndGroupKey }, + Key: { PK: siteAndGroupKey }, }); if (Item == null) { diff --git a/src/authorizeRequest/getProtectedSites.js b/src/authorizeRequest/getProtectedSites.js index cd9484b..7815603 100644 --- a/src/authorizeRequest/getProtectedSites.js +++ b/src/authorizeRequest/getProtectedSites.js @@ -17,7 +17,7 @@ async function getProtectedSites() { const { Item } = await dynamoDb.get({ TableName: tableName, - Key: { SiteAndGroupKey: 'PROTECTED_SITES' }, + Key: { PK: 'PROTECTED_SITES' }, }); const { ProtectedSites } = Item; diff --git a/src/getOrCreateObject/resizeAndSave/lookupCustomCrop.js b/src/getOrCreateObject/resizeAndSave/lookupCustomCrop.js index 0e57a00..2c3d380 100644 --- a/src/getOrCreateObject/resizeAndSave/lookupCustomCrop.js +++ b/src/getOrCreateObject/resizeAndSave/lookupCustomCrop.js @@ -28,7 +28,7 @@ async function lookupCustomCrop(url, domain, sizeMatch) { const params = { TableName: tableName, Key: { - SiteAndGroupKey: `SIZES#${domain}${siteName}`, + PK: `SIZES#${domain}${siteName}`, }, };