@adobe/spacecat-shared-data-access 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-data-access-v1.1.6](https://github.com/adobe-rnd/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.1.5...@adobe/spacecat-shared-data-access-v1.1.6) (2023-12-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * use getItem for latest audit ([#35](https://github.com/adobe-rnd/spacecat-shared/issues/35)) ([6e4a87e](https://github.com/adobe-rnd/spacecat-shared/commit/6e4a87ea2d515f632b34278a8cc1ffd51d692a16))
7
+
1
8
  # [@adobe/spacecat-shared-data-access-v1.1.5](https://github.com/adobe-rnd/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.1.4...@adobe/spacecat-shared-data-access-v1.1.5) (2023-12-05)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -151,17 +151,12 @@ export const getLatestAuditForSite = async (
151
151
  siteId,
152
152
  auditType,
153
153
  ) => {
154
- const latestAudit = await dynamoClient.query({
155
- TableName: config.tableNameLatestAudits,
156
- KeyConditionExpression: 'siteId = :siteId AND auditType = :auditType',
157
- ExpressionAttributeValues: {
158
- ':siteId': siteId,
159
- ':auditType': `${auditType}`,
160
- },
161
- Limit: 1,
154
+ const latestAudit = await dynamoClient.getItem(config.tableNameLatestAudits, {
155
+ siteId,
156
+ auditType,
162
157
  });
163
158
 
164
- return latestAudit.length > 0 ? AuditDto.fromDynamoItem(latestAudit[0]) : null;
159
+ return latestAudit ? AuditDto.fromDynamoItem(latestAudit) : null;
165
160
  };
166
161
 
167
162
  /**