@dmptool/utils 1.0.22 → 1.0.23
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 +6 -4
- package/package.json +1 -1
package/dist/dynamo.js
CHANGED
|
@@ -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