Skip to content

Commit

Permalink
Fix validation for removed terms types
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiSG authored Sep 6, 2023
2 parents 60a2343 + 665db13 commit 91b4b55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## Unreleased [patch]

### Fixed

- Fix validation for removed terms types

## 0.30.0 - 2023-07-10

Expand Down
4 changes: 4 additions & 0 deletions scripts/declarations/validate/index.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export default async options => {
if (!schemaOnly && service) {
service.getTermsTypes()
.filter(termsType => {
if (!service.terms[termsType]?.latest) { // If this terms type has been deleted and there is only a historical record for it, but no current valid declaration
return false;
}

if (servicesTermsTypes[serviceId] && servicesTermsTypes[serviceId].length > 0) {
return servicesTermsTypes[serviceId].includes(termsType);
}
Expand Down

0 comments on commit 91b4b55

Please sign in to comment.