@dmptool/utils 1.0.22 → 1.0.24
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/dist/dynamo.js +7 -5
- package/package.json +1 -1
package/dist/dynamo.js
CHANGED
|
@@ -203,7 +203,7 @@ const getDMPs = async (dynamoConnectionParams, domainName, dmpId, version, inclu
|
|
|
203
203
|
}
|
|
204
204
|
else {
|
|
205
205
|
// Just return the RDA Common Standard metadata record
|
|
206
|
-
return items.map(item => ({ dmp:
|
|
206
|
+
return items.map(item => ({ dmp: item }));
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
}
|
|
@@ -311,10 +311,12 @@ const createDMP = async (dynamoConnectionParams, domainName, dmpId, dmp, version
|
|
|
311
311
|
throw new DMPToolDynamoError('Missing Dynamo config, DMP ID or DMP metadata record');
|
|
312
312
|
}
|
|
313
313
|
// If the version is LATEST, then first make sure there is not already one present!
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
314
|
+
if (version === exports.DMP_LATEST_VERSION) {
|
|
315
|
+
const exists = await (0, exports.DMPExists)(dynamoConnectionParams, dmpId);
|
|
316
|
+
if (exists) {
|
|
317
|
+
dynamoConnectionParams.logger.error({ dmpId }, 'Latest version already exists');
|
|
318
|
+
throw new DMPToolDynamoError('Latest version already exists');
|
|
319
|
+
}
|
|
318
320
|
}
|
|
319
321
|
try {
|
|
320
322
|
// If the metadata is nested in a top level 'dmp' property, then unwrap it
|
package/package.json
CHANGED