Skip to content

Commit

Permalink
adjust logic as onRecordFound expects distribution records now
Browse files Browse the repository at this point in the history
  • Loading branch information
t83714 committed Apr 17, 2024
1 parent 7323a87 commit 264679c
Show file tree
Hide file tree
Showing 3 changed files with 239 additions and 269 deletions.
9 changes: 6 additions & 3 deletions src/onRecordFound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ export default async function onRecordFound(
requestOpts: CoreOptions = {},
ftpHandler: FTPHandler = new FTPHandler()
) {
const distributions: Record[] =
record.aspects["dataset-distributions"] &&
record.aspects["dataset-distributions"].distributions;
const distributions: Record[] = [record];
const dcatDistributionsStringsAspect =
record?.aspects?.["dcat-distribution-strings"];
if (!dcatDistributionsStringsAspect) {
return Promise.resolve();
}

if (!distributions || distributions.length === 0) {
return Promise.resolve();
Expand Down
Loading

0 comments on commit 264679c

Please sign in to comment.