Skip to content

Commit

Permalink
fix: latest audit result to validate array
Browse files Browse the repository at this point in the history
  • Loading branch information
dzehnder committed Jan 3, 2025
1 parent 8a36b0a commit eef6e0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
24 changes: 3 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/spacecat-shared-data-access/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"@adobe/spacecat-shared-dynamo": "1.5.1",
"@adobe/spacecat-shared-utils": "1.25.2",
"@adobe/spacecat-shared-utils": "1.25.4",
"@aws-sdk/client-dynamodb": "3.716.0",
"@aws-sdk/lib-dynamodb": "3.716.0",
"@types/joi": "17.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/* c8 ignore start */

import { isIsoDate, isNonEmptyObject } from '@adobe/spacecat-shared-utils';
import { isArray, isIsoDate, isNonEmptyObject } from '@adobe/spacecat-shared-utils';

import Audit from '../audit/audit.model.js';
import SchemaBuilder from '../base/schema.builder.js';
Expand All @@ -37,7 +37,7 @@ const schema = new SchemaBuilder(LatestAudit, LatestAuditCollection)
.addAttribute('auditResult', {
type: 'any',
required: true,
validate: (value) => isNonEmptyObject(value),
validate: (value) => isNonEmptyObject(value) || isArray(value),
set: (value, attributes) => {
// as the electroDb validate function does not provide access to the model instance
// we need to call the validate function from the model on setting the value
Expand Down

0 comments on commit eef6e0f

Please sign in to comment.